Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add amount

Status
Not open for further replies.

misulica

Programmer
Feb 8, 2003
43
RO
In a table column I have in 1..n records each amount per product.How can I add those amounts so in a chart to display only the total amount?
Do I have to build another table with a column in which to put these total amount and from here to build the chart?
 
misulica

Use a variable:
Public nTotal
select myTable
calc sum(amount) to nTotal

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
OK, this is the total(now I introduced another variable) for January.But for the other 11 months?
 
Hi misulica

SELECT SUM(FieldAmount) AS myField, ;
MONTH(fielddDate) AS myMonth ;
FROM myTable GROUP BY myMonth INTO CURSOR myCursor

The above will create a myCursor with totals by month which can be used. Also include other firlds you want to include.
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top