Hej!
Så här gör jag för att skriva ut min serietabell. Här följer SQL satsen:
strSQL = "SELECT COUNT(*) FROM tblSpel WHERE ligaid = " & intID & " GROUP BY hlag ORDER BY hlag"
Set objRSH = Conn.Execute(strSQL)
strSQL = "SELECT COUNT(*) FROM tblSpel WHERE ligaid = " & intID & " AND hmal IS NOT null GROUP BY hlag ORDER BY hlag"
Set objRSHM = Conn.Execute(strSQL)
strSQL = "SELECT hlag, COUNT(*) FROM tblSpel WHERE ligaid = " & intID & " AND hmal > bmal GROUP BY hlag ORDER BY hlag"
Set objRSHV = Conn.Execute(strSQL)
strSQL = "SELECT COUNT(*) FROM tblSpel WHERE ligaid = " & intID & " AND hmal = bmal GROUP BY hlag ORDER BY hlag"
Set objRSHO = Conn.Execute(strSQL)
strSQL = "SELECT COUNT(*) FROM tblSpel WHERE ligaid = " & intID & " AND hmal < bmal GROUP BY hlag ORDER BY hlag"
Set objRSHF = Conn.Execute(strSQL)
strSQL = "SELECT Sum(hmal) FROM tblSpel WHERE ligaid = " & intID
Set objRSHGJ = Conn.Execute(strSQL)
strSQL = "SELECT Sum(bmal) FROM tblSpel WHERE ligaid = " & intID
Set objRSHIN = Conn.Execute(strSQL)
Och för att skriva ut använder jag:
Response.Write("Lagnamn ")
Response.Write objRSHM(0)
Response.Write(" ")
Response.Write objRSHV(0)
Response.Write(" ")
Response.Write objRSHO(0)
Response.Write(" ")
Response.Write objRSHF(0)
Response.Write(" ")
Response.Write objRSHGJ(0)
Response.Write(" - ")
Response.Write objRSHIN(0)
Response.Write(" ")
Response.Write FormatNumber(objRSHV(0)*3+objRSHO(0),0)
Response.Write("<br>")
Men detta skriver ut:
Lagnmn 2 2 2 1 14 - 12 8
Lagnmn 2 2 2 1 14 - 12 8
Lagnmn 2 2 2 1 14 - 12 8
Lagnmn 2 2 2 1 14 - 12 8
Lagnmn 2 2 2 1 14 - 12 8
Jag vill att den skall hämta statistik från ett lag och skriva ut, sedan det andra osv så det bir såhär:
Lagnmn 3 2 0 1 19 - 2 8
Lagnmn 3 2 0 1 14 - 2 8
Lagnmn 3 2 0 1 14 - 14 8
Lagnmn 4 1 1 2 14 - 12 8
Lagnmn 3 1 0 2 14 - 102 8
Tack på förhand!