I need a query to show when records do NOT match

G

Guest

How do I create a query to show when records do NOT match?

My data is something like this.
TABLE 1 TABLE 2
item number item number
A 1 A 1
B 2 B 4
C 9 C 6
D 5 D 3

I can create a query for when "item" and "number" match. That's fine. But I
need a query that tells me when "Item" does match, but "number" does not. I
want the results of this query to look like:
item Table1.number Table2.number
B 2 4
C 9 6
D 5 3

No matter what I do, I can't figure out how to generate this query. Thanks.
 
J

John Spencer (MVP)

SELECT Table1.Item, table1.Number, Table2.Number
FROM Table1 Inner Join Table2 on Table1.Item = Table2.Item
WHERE Table1.Number <> Table2.Number

If you are using the grid and can't figure out the sql above, post back for
further instructions.
 

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

Top