Compare - Output is any value Not Equal

D

Darby

I have two tables - each table contains the same unique identifier. I have
200 ids in one and 250 id values in another. I need to compare and have the
output be the 50 id values that don't match the other table. Any suggestions?

Thanks
 
D

Douglas J. Steele

Try the Find Unmatched Query wizard. Note that you may need to do it both
ways, in case there aren't 200 ids that are in both.
 
G

George Nicholson

1) Use the New Query Wizard and select "Find Unmatched Query Wizard"

2) Use this SQL as a guide to writing your own:
SELECT TableWithValues.ID,
TableWithValues.WhateverElseYouWantToSeeFromTableWithValues
FROM TableWithValues LEFT JOIN TableMissingValues
ON TableWithValues.ID = TableMissingValues.ID
WHERE (((TableMissingValues.ID) Is Null));

The LEFT JOIN says "include ALL records from TableWithValues. The
"WHERE..IsNull" limits the records returned to only those that have no ID
matches in TableMissingValues.

Note: unless you are *110% sure* that all 200 values are among the 250, you
should do this comparison both ways to insure that the 200 records don't
include any IDs that aren't present in the 250 set. Assumptions can come
back to bite at the worst times.

HTH,.
 
Top