ACCESS SQL

JArndt42
JArndt42 used Ask the Experts™
on
I know what I am looking for but am having a brain freeze on how to get it. I need to get the name of a category that a user is not qualified. I have three tables, tblUsers, tblQualifications and tblQualificationHeader. so I want
 
tblQualificationHeader is where UserName and QualificationID. so i can easily see the categories that say username MONA has qualified for. What I want to see is the categories that MONA is NOT qualified for.

Thanks all.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
Commented:
SELECT * FROM tbl_qualifications
WHERE QualificationID NOT IN (SELECT QualificationID FROM tblQualificationHeader WHERE USERName = "Mona")
Owner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
Commented:
or you could use (this will probably run quicker)

SELECT *
FROM Qualifications as Q
LEFT JOIN (SELECT QualificationID FROM tblQualificationHeader WHERE UserName = "Mona") as UQ
ON Q.QualificationID = UQ.QualificationID
WHERE UQ.QualificationID IS NULL

Author

Commented:
Thank you very much. I have quite a bit to learn of imbedded queries. I will use the second as it seems a smidge quicker.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial