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

Totals

Status
Not open for further replies.

NWTrust

Technical User
Apr 2, 2002
68
GB
I have 'inherited' a database. In it is a query which looks like a simple Select query but when it is run it produces a table with a bottom line of Totals with the sum of the numbers at the foot of the numeric fields. I would like to do something similar in a database I am working on but I cannot see how the query works. Copying the query into my database and setting a different file produces a table without the totals! Can anyone put me on the right track, please?
 
One usual way to do this is an UNION query.
Did you even try to look at the SQL code of the working query ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes, PHV, I did. This is it:
SELECT Events.[Event Name], Events.Category, Events.[Number of children attended], Events.[Number of Adults attended], Events.Date
FROM Events
WHERE (((Events.Category)=[enter category]));
 
Recent versions of Access allow you to click on the Totals button on the ribbon when viewing the query datasheet. In the new Total line, you can select if you want to see Sum or Avg or whatever.

Duane
Hook'D on Access
MS Access MVP
 
I do what PHV suggested frequently.

Query that provides the detail
union
Query that provides the total

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top