Missing Registrations By Class

md57780

Registered User.
Local time
Today, 09:33
Joined
Nov 29, 2010
Messages
18
I've got three tables: Users, Classes, Registration. The Registrations table is my join table between Users and Classes. The fields are pretty simple.

Users: UserID
Registration: RegistrationID, UserID, ClassID
Classes: ClassID

I need to identify which users have not registered for which classes, listed by class.

I can show users that have registered by class and I can get which users have not registered for a single class, but I need each class listed showing each user that hasn't registered for that class.

It may be a simple, but for some reason I can't get my mind around how to connect the Classes table with users that haven't registered.

Any help?
 
I've came up with a solution, although maybe not the best. If anyone has the "proper" method for accomplishing this, please let me know.

Code:
SELECT Classes.ClassID, Users.UserID
FROM Classes, Users
WHERE (Classes.ClassID & "-" & Users.UserID Not In 
  (SELECT Registration.ClassID & "-" & Registration.UserID FROM Registration
   WHERE (Registration.ClassID = Classes.ClassID AND Registration.UserID = Users.UserID)));
 
Last edited:

Users who are viewing this thread

Back
Top Bottom