Summing columns

Results 1 to 2 of 2

Thread: Summing columns

  1. #1
    Join Date
    Dec 1969

    Default Summing columns

    I have a fairly complex SQL statement that is used to populate a recordset. This entire recordset is then written to a page. Is the an easy way to sum certain numeric colums of this recordset, even writing to an array and summing columns in the array?<BR><BR>Normally I would use another SQL statement with sum(relevant column) but it is getting a bit complex and I was hoping doing it in the recordset would be easier.<BR><BR>Performance should not be an issue max recordset size 100 X 10 and not pulled very often.<BR><BR>Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default Can't you do it while rendering the page?

    Do until rs.eof<BR><BR><BR>&#039; table rows here<BR><BR>intCalc1 = intCalc1 + rs("col1")<BR>intCalc2 = intCalc2 + rs("col2")<BR><BR>rs.movenext<BR>Loop<BR><BR>&#039 ; display results in final row

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts