column totals

G

Guest

In query; how do I get column totals. I can get get group
totals say by quarter. But how do I total all four
quarters.

QTR1 1000
QTR2 2000
QTR3 3000
QTR4 4000

TOTAL 10000
 
J

John Spencer (MVP)

This would require two queries in a UNION query. Something like the following
might work

SELECT Quarter, Amount
FROM Table1
UNION ALL
SELECT "TOTAL", Sum(Amount)
FROM Table1
ORDER BY Quarter

If you are doing this for a report, then you can use the reports grouping
function to do this without using the complex query. You would just add a
control to the group footer and set its control source to =Sum(Amount)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top