Datenbank: Access 2002
Einsatzbereich: ASP / Web / IIS 5.0

Hallo, 

ich habe folgendes Problem. Ich m�chte aus der Datenbank die Ver�nderten
Datens�tze der letzten drei Monate ausgeben. Die Ausgabe soll dann nach
Monat gruppiert werden. Im Klartext m�chte ich folgendes darstellen. 



Ausgabestruktur:
        ___________________________________________________
        Neue Lieder
                Du gro�er Gott 
                Heilig, heilig, heilig 
                Holy, Holy, Holy (Englisch)
                How Great Thou Art (Englisch)
                ...
        50% Deutsch - Jul. 2003
        ___________________________________________________
        Neue Lieder
                As The Deer Englisch 
                De mi amante Salvador (Spanisch)
                Dir, Ewiger, sei dieser Tag geweihet 
                Dort auf dem H�gel Golgatha 
                ...
        50% Deutsch - Jun. 2003
        ___________________________________________________
        Neue Lieder
                Adj �ld�st! (Ungarisch)
                Aqu� Reunidos (Spanisch)
                Come And Sing Praises (Englisch)
                Comprado con sangre por Cristo (Spanisch)
                ...
        0% Deutsch - Mai. 2003
        ___________________________________________________



Datenbankstruktur:
Das sind die notwendigen Felder aus der DB. Das Feld nDatumB gibt die
Letzte �nderung eines Liedes an. Das Feld nSprache bestimmt in welcher
Sprache das Lied ist. 

        � nLiedID � nTitel               � nSprache � nDatumB    �
...Weitere
        �     192 � Tis So Sweet to T... �        2 � 29.05.2003 � 
        �     214 � Du gro�er Gott       �        1 � 14.07.2003 � 
        �     204 � As The Deer          �        2 � 09.06.2003 � 
        �     179 � Ragyogj jobb honu... �        4 � 10.05.2003 � 
        �       6 � N�her, mein Gott,... �        1 � 22.11.2001 � 
        �      27 � Ich lieb dich Her... �        1 � 06.03.2003 � 
        �       1 � Damit ich leb', s... �        1 � 11.11.2002 � 
        �     217 � Mi Creador, mi Re... �        3 � 15.07.2003 � 
        �      28 � Suchst du einen F... �        1 � 06.03.2003 � 
        �     212 � Heilig, heilig, h... �        1 � 14.07.2003 � 
        �      65 � Tu e�ti Cel vredn... �        5 � 30.03.2003 � 
        �      33 � Wie ein Hirsch       �        1 � 08.03.2003 � 
        �     205 � Jesus, zu Dir kan... �        1 � 10.06.2003 �



Meine L�sung: 
<% Sub Sub_NeueLieder %>
<%      Dim RS, RS_Group
        Dim StatAlle, StatLang, StatMax
        Set RS_Group = ConMaster.Execute( "SELECT Top 3
DateSerial(DatePart('YYYY',nDatumB), DatePart('M',nDatumB), 1) AS
nDatumM FROM tblLied GROUP BY DateSerial(DatePart('YYYY',nDatumB),
DatePart('M',nDatumB), 1) Order by DateSerial(DatePart('YYYY',nDatumB),
DatePart('M',nDatumB), 1) Desc" ) 
        WHILE NOT RS_Group.EOF
                StatAlle = 0
                StatLang = 0
                StatMax  = 10
%><div class="fieldset_outside"><div class="legend"><%=
str002_000(nLangID) %></div><img src="_Pic/W02G700A.jpg" alt=""
width="100%" height="15px" border="0" class="fieldset_border_top"><div
class="fieldset_inside">
        <ul type="disc">
        <% Set RS = ConMaster.Execute( "SELECT * FROM tblLied WHERE
DateSerial(DatePart('YYYY',nDatumB), DatePart('M',nDatumB), 1)='"&
RS_Group("nDatumM") &"' Order by nTitel Asc" ) %>
        <% WHILE NOT RS.EOF %>
                <% StatAlle = StatAlle +1 %>
                <% If RS("nSprache") = CInt(nLangID) then StatLang =
StatLang +1 end if %><li><a href="W02F004A.ASP?nLiedID=<%= RS("nLiedID")
%>"><% If RS("nSprache") = CInt(nLangID) then%><strong><%= RS("nTitel")
%></strong><% Else %><%= RS("nTitel") %><% End If %></a> <% If
RS("nSprache") <> CInt(nLangID) then%><span class="Info_Sprache"><%=
str000_000(nLangID,RS("nSprache")) %></span><% End If %></li>
                <% If StatAlle = StatMax then %></div><div
class="fieldset_inside_hidden" id="Sub<%=
MonthName(DatePart("M",RS_Group("nDatumM")), 1) &
DatePart("YYYY",RS_Group("nDatumM")) %>"><div><div
class="fieldset_lessSL" onClick="ShowSub(Sub<%=
MonthName(DatePart("M",RS_Group("nDatumM")), 1) &
DatePart("YYYY",RS_Group("nDatumM")) %>, 0)">-</div></div><ul
type="disc"><% End If %>
        <% RS.MoveNext %>
        <% WEND %>
        </ul>
</div><img src="_Pic/W02G700A.jpg" alt="" width="100%" height="1"
border="0" class="fieldset_border_bottom"><% If StatAlle > StatMax then
%><div class="fieldset_moreSL" onClick="ShowSub(Sub<%=
MonthName(DatePart("M",RS_Group("nDatumM")), 1) &
DatePart("YYYY",RS_Group("nDatumM")) %>)">+</div><% End If %><div
class="fieldset_info"><%= Round((StatLang/StatAlle)*100, 2) %>% <%=
str000_000(nLangID,nLangID) %>   -  <%=
MonthName(DatePart("M",RS_Group("nDatumM")), 1) &". "&
DatePart("YYYY",RS_Group("nDatumM")) %></div></div>
<%        RS_Group.MoveNext
        WEND %>
<% Response.Flush %>
<% End Sub %>



Frage: Wie kann ich diese Ausgabe mit nur eine SQL Abfrage realisieren? 
       Welche Verbesserungsvorschl�ge habt ihr? Ist es m�glich oder
sinnvoll 
       nur eine abfrage zu benutzen? 



Gru� 
Ferenc J�nosi 


www.enek.de



_______________________________________________
Database.asp mailing list
[EMAIL PROTECTED]
http://www.glengamoi.com/mailman/listinfo/database.asp

Antwort per Email an