How to find out the difference between two tables?

D

Dawn

Dear all,
My mother-tongue is not english.So if there's something I cann't express
clear,pls be tolerant,thanks.
There are two tables,with the same field definations, but not all same
records.assuming table A is a snapshot of 2008-2-29,Table B is a snapshot of
2008-3-21.the key field in both table is AccountNO.
I try to use access 2003 to find out what accounts have been opened between
2008-2-29 and 2008-3-21.
Up to now ,I only have the experience to use the parameter "join",but this
case,I need to find out the difference.
Can u do me a favor ,as to show me how to solve it in access 200? ?
pls also give me a sql sentence.
many thanks.
 
J

John Spencer

To show records with an AccountNo in TableB that does not exist in TableA use
a "frustrated" outer join.

For example

SELECT TableB.*
FROM TableB LEFT JOIN TableA
ON TableB.AccountNo = TableA.AccountNo
WHERE TableA.AccountNo is Null

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
D

Dale Fye

Dawn,

You can use the query wizard to do this. Select Queries and new in the
database window. Then click the "Find Unmatched Query Wizard" option in the
list box, then click OK. The wizard will ask you which two tables to
compare, then it will ask you which fields to compare, and finally will ask
you which fields you want to display.

When you are done, take a look at the SQL view of the query. It should look
similar to what John posted.

HTH
Dale
 
D

Dawn

Dear John & Dale,
Thanks for your kindness.no matter what you help me for,u both really do me
a favor.As a chinese ,I welcome u to go to Beijin for the Olympics.
Many thanks,again.

YOurs,Dawn
 

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