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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing duplicate tables for missing records

Status
Not open for further replies.

rarubio1

Programmer
Jan 25, 2002
64
US
Table tblWO2 is a duplicate of tblWO1. Today I discovered that some of the work orders in tblWO1 do not exist in tblWO2. What query can I run to figure out which work orders exist in tblWO1 and not in tblWO2.

Thank,
RR :)
 
Code:
SELECT Column1, Column2, Column3
   FROM tblW02 W2 LEFT JOIN tblW01 W1 ON W2.WONum = W1.WONum
   WHERE W1.WONum IS NULL
 
Create a left join between the two tables.
Then put in the where clause where tblWO2.ID is null
 
Have you ever seen such fighting to answer people's questions and be helpful? Why can't it be more like this at the post office?
 
Make sure you check for missing records the other direction, too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top