Solved Total of totals in a query (1 Viewer)

Local time
Yesterday, 22:40
Joined
Sep 22, 2022
Messages
113
Hey all,

Another beginner question. I have a simple query that pulls trips by bus by day and totals the trips for all buses by the type of ridership... i.e. basic, sped, etc.

How can I make the table show totals at the bottom of each column so we know what the totals are for the year?

The SQL for this query is as follows.

SELECT Trip.[T-Date], Sum(Trip.[Basic-Count]) AS [SumOfBasic-Count], Sum(Trip.[Sped-Count]) AS [SumOfSped-Count], Sum(Trip.[HS-Count]) AS [SumOfHS-Count], Sum(Trip.[Walk-Count]) AS [SumOfWalk-Count], Sum(Trip.MaxCount) AS SumOfMaxCount
FROM SchoolYrDates, Vehicles INNER JOIN ([Trans-Type] INNER JOIN Trip ON [Trans-Type].CodeID = Trip.CodeID) ON Vehicles.VehicleID = Trip.VehicleID
WHERE (((SchoolYrDates.CurrentYear)=True))
GROUP BY Trip.[T-Date], SchoolYrDates.SchoolYRStart, SchoolYrDates.SchoolYrEnd
HAVING (((Trip.[T-Date]) Between [SchoolYrDates]![SchoolYRStart] And [SchoolYrDates]![SchoolYrEnd]))
ORDER BY Trip.[T-Date];


1665460827184.png
 

June7

AWF VIP
Local time
Yesterday, 21:40
Joined
Mar 9, 2014
Messages
5,471
Click the Sigma (Totals) button on the Home tab Records section.

Or build a report and use its Sorting & Grouping with aggregate calcs. This will allow display of raw data records as well as summary calcs.
 
Local time
Yesterday, 22:40
Joined
Sep 22, 2022
Messages
113
I am already summing on that report. It is totaling all the trips per day. I need it to sum up all the data by column now. Sounds like I need to delve into reports next.


1665462380254.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:40
Joined
May 7, 2009
Messages
19,243
not in your Query design.
create a Datasheet form for your query and display it.
click the Totals (sigma) on the ribbon while you are viewing the datasheet form (ribbon->home->records->Totals)
 
Local time
Yesterday, 22:40
Joined
Sep 22, 2022
Messages
113
Got it... THAT was simple. So much to learn still but that really helped. Thank you

I owe you a libation of your choice now...:D
 

June7

AWF VIP
Local time
Yesterday, 21:40
Joined
Mar 9, 2014
Messages
5,471
The Sigma works on tables, queries, and datasheet form. But your users should not work directly with tables and queries.
 
Local time
Yesterday, 22:40
Joined
Sep 22, 2022
Messages
113
Thanks June7... I am working to keep the users from direct access of the data. Locking this down will be a future question. :)
 

Users who are viewing this thread

Top Bottom