Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

Decision query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
upsman - 17 Apr 2008 00:51 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.