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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing columns in query results

Status
Not open for further replies.

mmiram

IS-IT--Management
Feb 4, 2005
45
US
Hi:

I have a query as follows:

Select name, sum(transcount) As TransCount
from sumtrans
group by name;


Here is my question. In the resultant dataset, is there any way, I can sum everything in the TransCount column without using Reports. I want the query itself to sum that resultant column and show a grand total at the bottom.

Thanks,
Ram.
 
Select name, sum(transcount) As TransCount
from sumtrans
group by name
UNION SELECT 'Grand Total', Sum(transcount) FROM sumtrans

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top