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

NOT Finding a Record Using Queries

P: 18
This one is a bit tough (for me). I'm running a query that looks through two unrelated tables: One table contains an ID and the name of a training document while the other table contains an ID, an employee name and the name of the training document he/she read.

My goal is to find the documents he/she did NOT read. Creating a query for finding documents that have been read is all good, but making one that looks for unread documents is making me cry. Here is what I've written although it does not work:
Expand|Select|Wrap|Line Numbers
  1. SELECT [DocName]
  2. FROM [MasterDocTable]
  3. LEFT JOIN [EmpTrainTable] ON [MasterDocTable].DocName = [EmpTrainTable].DocName
  4. WHERE [EmpTrainTable].DocName Is Null;
Much respect to any helper.
Jun 13 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 14,534
That query looks like it should work. Try the following small changes.

Expand|Select|Wrap|Line Numbers
  1. SELECT [MasterDocTable].[DocName]
  2. FROM [MasterDocTable] LEFT JOIN [EmpTrainTable] 
  3. ON [MasterDocTable].DocName = [EmpTrainTable].DocName
  4. WHERE [EmpTrainTable].DocName Is Null
  5. OR [EmpTrainTable].DocName LIKE "" ;
Jun 16 '07 #2

Post your reply

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