A second query, where you let the database to the addition for you might be in order, unless the select statement is time consuming.
 
e.g.
 
SELECT sum(t1.taxes) AS total_taxes, sum(t1.amount) AS total_amount
FROM t1
WHERE ...
 
 
The only other possible decent way would be to loop through the query result and add up the taxes and amount into a local variable.  (probably while you are printing out the table of detail)

Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes
[EMAIL PROTECTED]

 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike
Sent: Wednesday, April 10, 2002 10:38 AM
To: [EMAIL PROTECTED]
Subject: [CFTALKTor] math functions on multiple rows

Hello All,
 
I have query that returns approx 2500 records.  The fields are name, address, amount due, interest etc.  At the bottom of my display page I would like to add up all the values in the amount due, and add up all the interest amounts etc.
 
I have done math on two or three variables but never on so many values. Can anyone point me in the right direction.
 
Thanks
 
Mike
 

Reply via email to