By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 733 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

Distinct Query Help?

P: 5
Hi, I am a intermediate user who has a database of employees and their training history/courses attended. Can someone please help - I need to find out all the employees who HAVEN'T done a particular course. When I try to create a query and type in the course code as 'not' etc is shows me every course everyone has done (except the selected one). I only want a list of employees who haven't done that course. With their name appearing once. Distinct doesn't work on this either. What am I doing? Any help would be appreciated, however, I don't have much to do with SQL - am a basic query writer only. Please keep as simply as possible. THANK YOU!!!!! Kez
Aug 24 '06 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
In your query double click on the Join/Relationship line between the two tables and change the join to be all records in employyes table and only those records in the courses taken table that are equal.

If you put this criteria
Is Null
under the unique ID column of the courses taken table the query should only return employees without a corresponding record in the courses taken table.

You may need further criteria to only return a particular course.

Hi, I am a intermediate user who has a database of employees and their training history/courses attended. Can someone please help - I need to find out all the employees who HAVEN'T done a particular course. When I try to create a query and type in the course code as 'not' etc is shows me every course everyone has done (except the selected one). I only want a list of employees who haven't done that course. With their name appearing once. Distinct doesn't work on this either. What am I doing? Any help would be appreciated, however, I don't have much to do with SQL - am a basic query writer only. Please keep as simply as possible. THANK YOU!!!!! Kez
Aug 24 '06 #2

P: 5
In your query double click on the Join/Relationship line between the two tables and change the join to be all records in employyes table and only those records in the courses taken table that are equal.

If you put this criteria
Is Null
under the unique ID column of the courses taken table the query should only return employees without a corresponding record in the courses taken table.

You may need further criteria to only return a particular course.
Hi again, thanks for the reply. I need the query, however, to return all the names of employees who haven't done a particular course. When I enter the course number I get employees and every course they have done (except the course I enter). I only want their names appearing once. Can you help? Thanks so much...
Sep 25 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.