Total/Count

C

Chris

I have set up a report based off of a table. It is a bit complicated. What
I want to do is in the report have the determined overall ranking of a
student be printed out of the total number of students represented. I have
figured out the ranking based upon a calculation. This is not the problem.
What I am having trouble doing is having Access generate the total number of
students for the report. For example, if a student ranks #30 out of 100
students, I want the report to read "Rank 30 out of 100." I can do this if I
manually put in the number 100 in a separate field in the report. However, I
would like the program to generate this total automatically because this
number will change from year to year, and I want to avoid having to do this
manually. Any suggestions?
 
D

Dave M

If you create a summation query that calculates the total number of
students, you can then add it to whatever collection of tables and queries
makes supports your report, but don't join it to anything.

The summation query, let's call it qryStudentCount, would look something
like

SELECT COUNT([StudentID]) As StudentCount FROM [tblStudents]

and it would display one column (StudentCount) with one row showing the
number of students, 100

If you have another query that ranks the students, say qryStudentRankings
and it has a column namde StudentRank, then you could use a query like

SELECT [StudentRank],[StudentCount] FROM qryStudentRankings, qryStudentCount

which would list all the rankings, but the same count for each one.

This is an example of a Cartesian product, which is often a mistake, but
sometimes useful, as here.
 
Top