CrossTab Group Totals

S

sneeze

i have created a crosstab query that works great but I have a problem in that
I need a grand total of the field called Total on the last line that totals
the Total column. Any suggestions
 
K

KARL DEWEY

Make your crosstab from a union query with your table and a totals query that
looks like this --
qryTable --
SELECT YourTable.Product, YourTable.ProdDate, YourTable.Score
FROM YourTable
UNION ALL SELECT "Grand_Total" AS Product, Null AS ProdDate,
Sum(YourTable.Score) AS Total_Score
FROM YourTable
GROUP BY "Grand_Total", Null;

TRANSFORM Sum(qryYourTable.[Score]) AS SumOfScore
SELECT qryYourTable.[Product], Sum(qryYourTable.[Score]) AS [Total Of Score]
FROM qryYourTable
GROUP BY qryYourTable.[Product]
PIVOT Format([ProdDate],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top