PeterWieland
Registered User.
- Local time
- Today, 21:04
- Joined
- Sep 20, 2000
- Messages
- 74
This question has been posted a couple of times before, but does not seem to have been fully answered.
I have database for recording student assesments. There is one record per student/subject, with 6 fields, one for each of 6 assesments throughout the year i.e
Name,Subject,Attain1,Attain2,Attain3,Attain4,Attain5,Attain6
Each student has one record for each subject. ie
Mary,Maths,A,B,B,A,A,A
Mary,Science,C,B,C,B,A,B
etc.
I have a crosstab query which produces a total of each grade for ONE column ie
Name,A,B,C,D,E
Mary,2,4,3,0,0
ie Mary got 2 A's, 4,B's and 3 C's
This all works fine.
Now the question!
The crosstab has the following PIVOT:
PIVOT qryGrades.Attain2 In ("A","A*","B","C","D","E","F","G","N","Na","U");
How can I have the field 'Attain2' assigned by a variable, so that the one query could be used for any of the 6 assesments. I have over 100 queries in the full database, and do not want to multiply this by 6 to give one for each module.
Hope this all makes sense,
Peter Wieland
I have database for recording student assesments. There is one record per student/subject, with 6 fields, one for each of 6 assesments throughout the year i.e
Name,Subject,Attain1,Attain2,Attain3,Attain4,Attain5,Attain6
Each student has one record for each subject. ie
Mary,Maths,A,B,B,A,A,A
Mary,Science,C,B,C,B,A,B
etc.
I have a crosstab query which produces a total of each grade for ONE column ie
Name,A,B,C,D,E
Mary,2,4,3,0,0
ie Mary got 2 A's, 4,B's and 3 C's
This all works fine.
Now the question!
The crosstab has the following PIVOT:
PIVOT qryGrades.Attain2 In ("A","A*","B","C","D","E","F","G","N","Na","U");
How can I have the field 'Attain2' assigned by a variable, so that the one query could be used for any of the 6 assesments. I have over 100 queries in the full database, and do not want to multiply this by 6 to give one for each module.
Hope this all makes sense,
Peter Wieland