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

NOT Finding a Record Using Queries

ebs57
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;
  5.  
Much respect to any helper.
Jun 13 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
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 "" ;
  6.  
Jun 16 '07 #2

Post your reply

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