Finding Missing records

D

Drew

I have a staff training access database that I need to write a query for...
here are the details, (these were not built by me, I just have to fix them)

StaffCoreTable
StaffID - Unique ID for staff
StaffFName - First Name
StaffLName - Last Name
Other fields are present, just not relevant now

ClassesTaughtTable
ClassTitle - Title of Class
ClassNo - Unique class number
StartDate - Date of start
EndDate - Ending date
Comments - Comments regarding class

TrainingTable
StaffID - ID from StaffCoreTable
ClassNo - Class # from ClassesTaughtTable
Score - score of class

How can I find out which employees have NOT had a certain class?

Thanks,
Drew Laing
 
D

Drew

The assumption is incorrect. Since the staff does not have the class, they
were never entered, therefore that query will not work.

In otherwords, for class 40, there are only 5 records, so in other words I
would need to return the 138 other people in the database.

Thanks,
Drew
 
D

Douglas J. Steele

What you want is LEFT JOIN between StaffCoreTable and the other two tables,
and only return those rows in StaffCodeTable where the resultant row in
TrainingTable is null.
 

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