Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find records that exist in one table and do not exist in another 1

Status
Not open for further replies.

ringadeal

Technical User
Joined
Jan 16, 2008
Messages
67
Location
US
I have 2 tables with almost identical data except that one has several extra records. How can I easily locate these extra records based on the records of the other table which does not contain these extra records?
 
In the query tab, click on "New", then "Find Unmatched Query Wizard". Follow the instructions...

"Before you criticize someone, you should walk a mile in their shoes.
That way, when you criticize them, you're a mile away and you have their shoes."
 
I have 2 tables with almost identical data except that one has several extra records. How can I easily locate these extra records based on the records of the other table which does not contain these extra records?

If they have a common field you could do a "Not In" select statement.

You could post more information on your tables
 
Would the syntax be:

Select table1.field1 from table1 WHERE table1.field1 Not In table2.field1

thanks for your assistance
 
Field1 would need to be unique to both table so if Field1 is an "Autonumber Primary key" then it might not be accurate.

Something like this:

Code:
SELECT sLastName
FROM Table1
WHERE sLastName Not In (SELECT sLastName FROM Table2);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top