NotIn Function? Need a query based on 2 tables.

C

Chris

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
 
J

JK

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
 
O

Ofer Cohen

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
 
Top