ES-Components
asked on
Can I Sum and Subtract In One SQL Statement?
I am using Dreamweaver with ASP.
I have three fields where I have to sum two fields and then subtract the total from the third field. (Customer1 + Customer2) then subtract from Total Inv$
The select statement I think, would be something like this, BUT this one DOES NOT work.
SELECT SUM(Total Inv$)-(Sum(Customer1+Custo mer2))
WHERE Date=Date()
Any way of doing this?
Thank you...
Rick
I have three fields where I have to sum two fields and then subtract the total from the third field. (Customer1 + Customer2) then subtract from Total Inv$
The select statement I think, would be something like this, BUT this one DOES NOT work.
SELECT SUM(Total Inv$)-(Sum(Customer1+Custo
WHERE Date=Date()
Any way of doing this?
Thank you...
Rick
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did get this to work.
Thank you for your quick response.
Rick
Thank you for your quick response.
Rick
This will give you the result in each row of the table. If you need the total of it all, then
select sum(field3 - (field1+field2) ) from mytable