totalling Columns from a Query result ??

Results 1 to 2 of 2

Thread: totalling Columns from a Query result ??

  1. #1
    Paul M Guest

    Default totalling Columns from a Query result ??

    Does anyone know how to do this:<BR>I have a page that displays the results of a query posted to it from another<BR>page.<BR>But I would like to be able to add a total for each column that is returned.<BR>e.g.<BR>If the query is SELECT * from Films Where Actor is like Mel gibson, this<BR>would return multiple rows of data, and If one of the columns is Gross Takings,<BR>I would a total at the bottom of the page totalling all the gross takings.<BR><BR>I hope this makes sense, I have got everything else to work apart from the<BR>total for the columns.<BR><BR>Any help would be much appreciated.<BR><BR>Paul<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: totalling Columns from a Query result ??

    Yes, use the ADDITION operator (+)<BR><BR>As you iterate through the recordset to display it, add up the values! e.g. grosstakings = grosstakings + rs("grosstakings")

Posting Permissions

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