Excluding a field from the second table in a join

sudhirhinduja

Registered User.
Local time
Today, 04:51
Joined
Aug 17, 2004
Messages
41
Hello,

I have 2 tables.

1) Table A, which is a table of all 100,000 users
2) Table B, which is a table of all other users

I have a query qryA, which looks for everyone in table A with a certain type of job title.

I want to exclude anyone who works for a company that occurs in the table B from showing up in the qryA query.

Any ideas?
 
Hi

Assuming there is a field common to the 2 tables, include both tables in your query, and change the join between the tables to include all records from Table A and only matching records from Table B (double click on the link between the tables to access this option).

Include the job title from Table A in your query and insert the critieria you want. Include the id field from table B in your query, and set the criteria to 'Is Null' (without the quotes). Add any other fields you want to see in the query.

That should provide what you want.

HTH, Andrew :)
 
Andrew's answer will work if you want to exclude all companies that appear in TableB. I interpreted your question a bit differently. I read it as excluding a specific company. If that's the case, just set your criteria to:

<> "Company"
 

Users who are viewing this thread

Back
Top Bottom