View Full Version : Two tables, one duplicate querie


rotteneggz
03-15-2009, 08:22 PM
Hello all,
I have two sets of data seperated in two tables in access.
Table 1 consists of; Company Name, Address, City, State, Zip
Table 2 consists of; Company Name, Address, City, State, Zip, Phone Numbers

What i want to do, is compare the two tables, and for every duplicate result from both tables, i want to add the phone number from table 2 to it.

Ex:
Table 1
Company Name*Address*City*State*Zip
Al's Tire Shop*566 5th St.*New York*NY*10002
Pizzaria*9889 Hemmington*New York*NY*10003

Table 2
Company Name*Address*City*State*Zip*Phone Number
Al's Tire Shop*566 5th St.*New York*NY*10002*2128664885
Jim's Repair*8776 Bloob*New York*NY*10012*2128558445

Result In New Table
Company Name*Address*City*State*Zip*Phone Number
Al's Tire Shop*566 5th St.*New York*NY*10002*2128664885

John Big Booty
03-15-2009, 08:29 PM
If you go to the queries section in the DB window, and click on the New button in the top of the DB Window, you will get a New Query Wizard menu that includes Find Duplicates Query Wizard and Find Unmatched Query Wizard using those two wizards you should be able to do what you are looking for if you use them in conjunction with an Update query.

rotteneggz
03-15-2009, 09:33 PM
If you go to the queries section in the DB window, and click on the New button in the top of the DB Window, you will get a New Query Wizard menu that includes Find Duplicates Query Wizard and Find Unmatched Query Wizard using those two wizards you should be able to do what you are looking for if you use them in conjunction with an Update query.

Hey thanks for the quick reply. Im using Access 2007 and when i run the Find Duplicates Query Wizard, it only allows me to select collumns from one table. In my case i have two separate tables.

John Big Booty
03-15-2009, 10:00 PM
Sorry my bad, I forgot that the Find Duplicate only looks in one table.

What you will need to do is create a query and select both tables in it. Drag a relation ship line between the Name field in one of those tables to the Name field in the other table. Select what ever other fields you want in your query. You should now be able to use that query as part of a find unmatched query.