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

Query Help -

P: 19
I have a table which tracks various contacts with a client. The setup looks like this:

Cust#, DateContact, typeContact, ContactResult.

Not all customers in the DB have a contact record (have not been contacted). some have one, some more than one.

I need to select all the records of a customer that have been contacted with a contactresult=faxedItem but do not also have contactresult=faxreturned in the same table.

This example would show me everyone I have faxed to but that I haven't yet received something back (thus more follow-up is necessary).

I have other things along this method that I also need to do but this should get me going.

thanks!
Aug 9 '07 #1
Share this Question
Share on Google+
2 Replies


JKing
Expert 100+
P: 1,206
Hi, I think this is what you're looking for:

Expand|Select|Wrap|Line Numbers
  1. SELECT tblCustomer.[cust#], tblCustomer.DateContact, tblCustomer.typeContact, tblCustomer.ContactResult
  2. FROM tblCustomer
  3. WHERE tblCustomer.ContactResult ='faxedItem'  
  4. AND [cust#] NOT IN (Select [cust#] FROM tblCustomer WHERE ContactResult = 'faxreturned');
  5.  
tblCustomer would be the name of your table.
Aug 9 '07 #2

P: 19
That did the trick!!!
Aug 9 '07 #3

Post your reply

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