Compare - Output is any value Not Equal

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

Guest

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
 
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.
 
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,.
 

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