Code:
TRANSFORM Count(qryDemogForCrosstab.StudentID) AS CountOfStudentID
SELECT qryDemogForCrosstab.Classification, Count(qryDemogForCrosstab.StudentID) AS [Total Of StudentID]
FROM qryDemogForCrosstab
GROUP BY qryDemogForCrosstab.Classification
PIVOT qryDemogForCrosstab.AgeGroup;
Total Of Student ID 18-24 25-64 65+ Undefined
ESOL 97 13 82 1 1
Pair 20 1 17 2
which is the expected result.
My question is: How can I get the counts under each age group to display as percentages of the Total Of Student ID per row? I was able to get percentages to show using
Code:
TRANSFORM Formatpercent(Count(qryDemogForCrosstab.StudentID/100,0) AS CountOfStudentID
I also tried this:
Code:
TRANSFORM Count(qryDemogForCrosstab.StudentID) AS CountOfStudentID
SELECT qryDemogForCrosstab.Classification, Count(qryDemogForCrosstab.StudentID) AS [Total Of StudentID],
Count(qryDemogForCrosstab.StudentID)/(Select Count(*) FROM qryDemogForCrosstab) AS Percentage
FROM qryDemogForCrosstab
GROUP BY qryDemogForCrosstab.Classification
PIVOT qryDemogForCrosstab.AgeGroup;