hi, Anyone can point me in the direction of a way to sum a database colum of numeric values.
I have table displayed with individual hit counts for all my links and I want to add all the hits to see the total and then post the result back to a webpage.
I have no working code except this that displays the results. I basically need to sum the total hits column.
Any wee pointers would be a great help.
Thanks in advance.
Richard
I have table displayed with individual hit counts for all my links and I want to add all the hits to see the total and then post the result back to a webpage.
I have no working code except this that displays the results. I basically need to sum the total hits column.
Code:
Response.Write "<TABLE BORDER=""1"">" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<TD><B>ID</B></TD>" & vbCrLf
Response.Write "<TD><B>Name</B></TD>" & vbCrLf
Response.Write "<TD><B>Location</B></TD>" & vbCrLf
Response.Write "<TD><B>Total Hits</B></TD>" & vbCrLf
Response.Write "</TR>" & vbCrLf
Do While Not rsLinkTracker.EOF
Response.Write "<TR>" & vbCrLf
Response.Write "<TD><A HREF=""details.asp?lid=" & rsLinkTracker.Fields("PostCardID").Value & """>" & rsLinkTracker.Fields("PostCardID").Value & "</A></TD>" & vbCrLf
Response.Write "<TD><A HREF=""details.asp?lid=" & rsLinkTracker.Fields("PostCardID").Value & """>" & rsLinkTracker.Fields("PostCardID").Value & "</A></TD>" & vbCrLf
Response.Write "<TD>" & rsLinkTracker.Fields("DefaultHeadline").Value & "</TD>" & vbCrLf
Response.Write "<TD>" & rsLinkTracker.Fields("totalhits").Value & "</TD>" & vbCrLf
Response.Write "</TR>" & vbCrLf
rsLinkTracker.MoveNext
Loop
Response.Write "</TABLE>" & vbCrLf
Any wee pointers would be a great help.
Thanks in advance.
Richard
Comment