I have a table that contains students and their grades for 4 quarters. There
is one record for each student for each class they attend. If a student
attends 8 classes there are 8 records in the table each containing their
grades for the 4 quarters. I want to create an honor roll query/report. If
a student got only A's and B's in ALL their classes for the 1st quarter,
their name would appear on the report. Here is the query I currently have:
SELECT DISTINCTROW [Students And Classes].StudentID, [Students And Classes].
Year
FROM [Students And Classes]
WHERE ((([Students And Classes].[1stQuarter])<"C"))
GROUP BY [Students And Classes].StudentID, [Students And Classes].Year
HAVING ((([Students And Classes].Year)="CurrYr"));
This looks at the student's class records and gives me those classes they got
an A or B in. If a student has 8 classes and gets an an A or B in only 3,
they appear on the report, which is not what I need. I need a query that
reads all 8 class records and if there's an A or B in ALL 8 classes, print it
on the report. How do I do a query that will read all 8 class records and
then make a decision based on all 8 records together as opposed to each
record separately?
Thanks for any help you can give.
Rod
KARL DEWEY - 17 Apr 2008 15:50 GMT
This works if the student took 8 classes --
SELECT DISTINCTROW [Students And Classes].StudentID
FROM [Students And Classes]
WHERE ((([Students And Classes].Year)="CurrYr") AND (([Students And
Classes].[1stQuarter])<"C"))
GROUP BY [Students And Classes].StudentID
HAVING (((Count([Students And Classes].[1stQuarter]))=8));

Signature
KARL DEWEY
Build a little - Test a little
> I have a table that contains students and their grades for 4 quarters. There
> is one record for each student for each class they attend. If a student
[quoted text clipped - 20 lines]
> Thanks for any help you can give.
> Rod
upsman - 18 Apr 2008 04:13 GMT
Thanks, this worked great.
>This works if the student took 8 classes --
>SELECT DISTINCTROW [Students And Classes].StudentID
[quoted text clipped - 9 lines]
>> Thanks for any help you can give.
>> Rod