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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

- Eliminate records existing in two tables

Status
Not open for further replies.

Christek

Technical User
Nov 27, 2002
4
DE
Hi,
i have 2 tables containing data in records. I want to eliminate records which are equal in field1 in both tables: table_1 and table_2.

Example:

table_1: table_2:
field1 field2 field1 field2
record1 a a record1 a a
record2 b b record2 b x
record3 c c

The target is to have a third table containing the "non-equal" records - non equal means: not equal in field1.
So the target table should be:

table_3:
field1 field2
record1 c c (table_1, record3 is not in table_2)
(remark: record b,b/ b,x is equal in field1 an doesn't appear in the target table)

I hope I made sense...

Thanks!
 
Hallo,
If you create a query and link the two fields, then change the type of link to 'Show all records in Table A and only those matching in table B' (something like that anyway)
Then put the table A fields in the output.
Add a field from the primary key from B into the output and use the criteria Is Null.
This should return all table A records with no matching table B record.
create another query to return all table B records with no matching table A record and join them in a Union query.
Hoorah!

Hope that helps,

- Frink

PS. Sorry about the poor English, I seem to have forgotten all the Microsoft names for things
 
Hi Frink,

thank you very much. I Understood your english without problems. Your answer was perfect.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top