Also so....

                  kat1    kat2 ...
bild2.jpg          2                1
katze.gif          7                2
...


Versuchs mal mit sowas (Achtung, ungetesteter Code...):

<%
Set kat = Server.createObject("Scripting.Dictionary")
Set rs = conn.execute("SELECT DISTINCT kategorie FROM main ORDER BY
kategorie")
Do while not rs.eof
        kat(rs("kategorie")) = 0
        rs.movenext
loop
Rs.close
Response.write "<table><tr><td></td>"
For each k in kat.Keys
        response.write "<th>" & k & "</th>"
next
Response.write "</tr>"

Set rs = conn.execute("SELECT  motiv, kategorie, COUNT(motiv) as anzahl
FROM main GROUP BY motiv, kategorie ORDER BY motiv,kategorie")
aktMotiv = ""
Do while not rs.eof
        If aktMotiv<>rs("motiv") then
                if aktMotiv<>"" then
                        writeLine aktMotiv,kat
                end if
                aktMotiv = rs("motiv")
                For each k in kat.Keys
                        kat(k) = 0
                next
        End if
        kat(rs("kategorie")) = rs("anzahl")
        rs.moveNext
Loop
writeLine aktMotiv,kat
Response.write "</table>"

Sub writeLine(motiv,kat)
        response.write "<tr><th>" & motiv & "</th>"
        For each k in kat.Keys
                response.write "<td>" & kat(k) & "</td>"
        next
        response.write "</tr>"
End sub
%>


Gruss,

CLaudius



| [aspdedatabase] als [email protected] subscribed
| http://www.aspgerman.com/archiv/aspdedatabase/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.aspgerman.com/aspgerman/listen/anmelden/aspdedatabase.asp

Antwort per Email an