Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing 2 tables

Status
Not open for further replies.

esengul

Instructor
Dec 9, 2004
59
US
i have 2 tables, i want to compare them and create a new table with these 2 tables.
Table1 Table2
A A
B B
C B!
D C
D! D
E E
E! F

so my new table should like these after comparing
NEW TABLE
Field1 Field2
A A
B B
"missing" B!
C C
D D
D! "missing"
E E
E! "missing"
"missing" F

I hope my example is clear. Please let me know how i can do this
Thanks in advance
 
What I would do is create two unmatched queries and combine them in a union query.

SELECT Table1.Field1, Table2.Field2 FROM Table1 LEFT JOIN Table2 ON Table1Field1 = Table2.Field2;

SELECT Table1.Field1, Table2.Field2 FROM Table1 RIGHT JOIN Table2 ON Table1.Field1 = Table2.Field2;

SELECT Field1, Field2 FROM Query1 UNION SELECT Field1, Field2 FROM Query2;
 
How are ya esengul . . . . .

Have you tried the [blue]Find Duplicates Query Wizard?[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top