Avatar of Keran O'Brien
Keran O'Brien
 asked on

Add Totals row to crostab query in Access

Hi,

I use the following pivot query in Access database to track the daily work rate of 9 teams:

TRANSFORM Count(Master.Actual) AS Units
SELECT Master.Actual
FROM Teams INNER JOIN Master ON Teams.ID = Master.Teams_ID
WHERE (((Master.Actual) Is Not Null))
GROUP BY Master.Actual
PIVOT Teams.ID

This gives me the dataset in the attached picture..
 Datatable produced by the Query
I have spent way too long trying to add a row to the bottom of that dataset to show the totals..can anyone help / explain? (i am aware there is a totals button in Access 2007 but this is not the solution)

Thanks for reading
Microsoft AccessMicrosoft OfficeMicrosoft Applications

Avatar of undefined
Last Comment
Lambert Heenan

8/22/2022 - Mon
infolurk

The totals button is the one that should give you column totals. Are you not using 2007, or is it not giving the desired value?

For row totals, add the value field again as a row heading.
Keran O'Brien

ASKER
Yes im using 2007 and it is the column totals im looking for but the query is to support a chart, so i need to calculate the totals as part of the query..dont i?

Row totals i can get, what im looking for is to add a single row to the bottom that shows the total for each column..is this posible? i can generate this row on its own usint a different query (that searches the query i have posted) but then i couldn't add it to the table using UNION..

Thanks for the reply..
ASKER CERTIFIED SOLUTION
Lambert Heenan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Lambert Heenan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Keran O'Brien

ASKER
@ LambertHeenan
Excellent, thank you.
Took me a while to understand it..I thought you couldnt use DISTINCT in access?!

Anyway thanks again.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Lambert Heenan

Glad to help. And SQL without DISTINCT would be kind of restricted, don't you think? :-)