Page 1 of 1

Summarising tables contents?

Posted: Thu Jul 18, 2002 2:47 am
by Hebbs
I have a table that contains customer information as in Name, payment method (cash/cheque/c/card etc), date of transaction and amount paid.

I can extract and display all of these entries individually OK, but how can I extract a summary of sales that only shows the total of all types

e.g.

In this example EG SMITH may have made ten cheque purchases totalling $200 and three cash totalling $100. Each purchase is listed in the table but I want to display a summary result like this result something like this

EG SMITH Cheque $200.00
Cash $100.00
Total $300.00


AB BROWN Cash $400.00
Total $400.00

P WHITE CCard $300.00
Cash $250.00
Cheque $125.00
Total $675.00

etc etc

Hebbs

Posted: Thu Jul 18, 2002 3:35 am
by haagen
What type of table do you have? Is it a database table? How does it look like?

Posted: Sun Jul 21, 2002 9:02 pm
by Hebbs
Got it,

Used GROUP BY in the SQL statement.

SHould have gone to MYSql first!

Thanks

Hebbs