Find Unmatched Records

geralf

Registered User.
Local time
Today, 16:40
Joined
Nov 15, 2002
Messages
212
Query to find records not matching?

Hi,

How do I do this:

I have two tables. Both has a field that has the same values (ID number). A second field (quantity) in both tables, contains a numeric value. How do I find the records that don't match for the quantity field?

One of the tables is a dBase table (linked)


TIA
 
Use the Unmatched Query Wizard
 
Hi!

I'm not sure whether I understand you correctly, but maybe this helps?

SELECT Table_1.id, Table_1.quantity FROM Table_1 LEFT JOIN Table_2 ON Table_1.ID = Table_2.ID WHERE Table_1.quantity <> Table_2.quantity
 
Last edited:
Thanks for your hrlp both. You're spot on Clueless. Haven't tried it yet but it seems right. I don't like the wizzards very much, but thanks for the tip.
 
Clueless Newbie said:
Hi!

I'm not sure whether I understand you correctly, but maybe this helps?

SELECT Table_1.id, Table_1.quantity FROM Table_1 LEFT JOIN Table_2 ON Table_1.ID = Table_2.ID WHERE Table_1.quantity <> Table_2.quantity

a more efficient way would be to use Is Null in the the query

like this:


Code:
SELECT Table_1.id, Table_1.quantity FROM 
Table_1 LEFT JOIN Table_2 ON 
Table_1.ID = Table_2.ID WHERE 
Table_2.quantity IS NULL
 
Last edited:

Users who are viewing this thread

Back
Top Bottom