NotIn Function? Need a query based on 2 tables.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here's the situation (simplified):

Table A has a field for Last Name. Table B has a field for Last Name. I
want to create a query that lists people in Table A who's Last Name is Not in
Table B at all.

For some reason, I can make a query that lists those people who's name is in
both, but not one to show the opposite.

Is there a NotIn function? Something like NotIn
![Last Name]

Thanks
 
The easiest way is to use the "Find Unmatched Query Wizard" in access.
To get to it, go to your database window, click on the Queries Object,
then the New button in the toolbar of that window.

The other way around it is via SQL. Do a Left Join on Last Name of the
two tables and find where Last Name = Null for the table on the right.

Hope this helps.
JK
 
You can use the query wizard to create an unmatch query to display which
record are in Table A but are not in Table B, something like

SELECT A.*
FROM A LEFT JOIN B ON A.[Last Name]= B.[Last Name]
WHERE B.[Last Name] Is Null
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top