Garren.Shannon
Member
- Local time
- Today, 08:56
- 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];
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];