Comparing Two Tables

S

Stephen Stark

I am trying to write a query that will compare two
tables, and produce a list of records that do NOT match
up. Does anyone know how I can accomplish this?

Thanks in advance.

Stephen Stark
(e-mail address removed)
 
R

Rick Brandt

Stephen Stark said:
I am trying to write a query that will compare two
tables, and produce a list of records that do NOT match
up. Does anyone know how I can accomplish this?

One of the options in the new query wizard is "Find Unmatched...".
 
T

Tom Ellison

Dear Stephen:

Perhaps it would be more useful to have a list of those rows that are
in Table A and not in Table B, and another list of those that are in
Table B and not in Table A. You can always make a UNION of these two
lists if you want them all scrambled together.

Make a SELECT query of table A with a LEFT JOIN to Table B, joined on
all the columns you need to compare. Create a criterion on any one
column in Table B that does not contain NULLs, and filter the query to
where that column IS NULL. That will give the list of all rows in A
not in B. Reverse this for the other list.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 

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