A "diff" routine

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access 2003 with Windows XP

I have two identically structured tables, with names, addresses, and phone
numbers. Within each table, the phone numbers are all unique. For clarity,
let's call them table A and table B. Let the fields be [Name], [Address] and
[Phone]. The crutial field is the phone number, and many phone numbers appear
in both tables.

I want to generate a new or third table (table C) that lists all the records
in table B where the phone number does not appear in table A. All other
fields do not matter during this selection, as the complete record from table
B will be replicated in table C, as long as the phone number is not in table
A..

I can envision several methods to get to the end result, but they seem
lengthy and cumbersome. There is no elegance in my solutions. This appears
to a problem which would have some frequency in data management.

Any suggestions for an elegant solution. Perhaps the third table is not even
a requirement, and a SELECT statement could achieve this.

Unix has a "diff" routine that handles this in a slick fashion.

I appreciate any guidance that might be offered. Thanks.
 
The Access Query Wizard has an "unmatched" query you could use to find
records from tableA that are not in tableB. And you can run it the other
way (B not in A) and find the reverse.

Are you sure you want a table when a query can do the job?
 
Back
Top