Compare querys

G

Guest

Hallo

I hope some on can help I am trying to compare two tables and I need a query
that only shows me the things that are missing from the one table that's not
in the other if you look at my example below Table 1 has all the data and
table2 has a missing 1 and 2 so I need a query that shows me that 1 and 2 is
missing from table2 how is this possible.

Table1 Table2
1 3
2 4
3 5
4
5

Many Thanks

Markus
 
J

Jeff Boyce

Markus

Access' Query Wizard has an "Unmatched..." template. This walks you through
finding values in Table1 that are not in Table2.
 
J

Jamie Collins

Markus said:
Table 1 has all the data and
table2 has a missing 1 and 2 so I need a query that shows me that 1 and 2 is
missing from table2

In a nutshell, OUTER JOIN (e.g. LEFT) and test for NULL in the other
table (table on the right):

SELECT Table1.MyCol FROM
Table1 LEFT JOIN Table2
ON Table1.MyCol = Table2.MyCol
WHERE Table2.MyCol IS NULL;

Jamie.

--
 

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