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!

SUM of a SUM field 1

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
I have a query pulling the sum of certain fields, and now I need to get the sum of that field:

SELECT SUM([field1]) AS ttlAmount
FROM

ORDER BY SUM([field1]) DESC;

I need the total Amount and the Grand total amount.

Any ideas?
 
Don't you ever call me that in public again! :)
Yes sir. Another query built off of your first. go for the sum of the sum fields. Quick and easy! Gord
ghubbell@total.net
 
Here's what I used in my church database to sum the sum of Tithe Offerings...

=Sum([Sum Of Tithe])
 
What do you mean by example???
I thought what I included in the first post *was* an example.
Thanks for your time!
 
Ok, as I understand, you want the first query
select sum(*) as x from xxx group by yyy
this will select differemnt sum for each yyy from table xxx.
select sum(*) from xxx will select the sum of all elements.
If you want a subquery, I don't know exactly how is it in access but in SQLServer you can do

select sum(t.x)
from
(select sum(*) as x from xxx group by yyy) as t
John Fill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top