Sum fra tabel/kolonne
Hvordan får jeg summen fra denne SQL-sætning:Query =\"SELECT ting.enhed, ting.ting, Sum(ting.antal) AS SumOfantal FROM ting GROUP BY ting.enhed, ting.ting\"
Jeg har prøvet med følgende der ikke virker:
<%
Set Conn = Server.CreateObject(\"ADODB.Connection\")
Conn.Open \"repro\"
Query =\"SELECT ting.enhed, ting.ting, Sum(ting.antal) AS SumOfantal FROM ting GROUP BY ting.enhed, ting.ting\"
Set rs = Conn.execute( Query )
total = SumOfantal
Set rs = Nothing
response.write total
%>
