Decision query

  • Thread starter upsman via AccessMonster.com
  • Start date
U

upsman via AccessMonster.com

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
 
K

KARL DEWEY

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));
 
U

upsman via AccessMonster.com

Thanks, this worked great.

KARL said:
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));
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
 

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