View Full Version : Filtering out duplicates while combining data


phoenix_angel
07-29-2003, 10:45 AM
Hello everyone - I'd be SOOOO appreciative of any help ya'll can offer me on this subject... Here's my issue:

I have to compile 2 tables into one while filtering out any duplicates. But I also need for Access to look at the duplicates and add any data that is not populated in the field. Like this:

Table One

CustomerName Address City Phone#
Barb Johnson 123 Butler Casselton



Table Two

CustomerName Address City Phone#
Barb Johnson 123 Butler Casselton 407-321-6637


I need to have Access identify the entry in table two as a duplicate and append the additional info - in this case it would be the phone# (obviously)

Any ideas here??

Thanks! Oodles 'n Oodles!

Captain Chaos
07-31-2003, 06:57 AM
if any of the fields in either table can be unpopulated how are you going know if they are actually duplicates? By definition duplicates are identical in all respects.

dcx693
07-31-2003, 09:16 AM
phoenix_angel, you need to decide what consitutes a duplicate. If you decide that if two records have the same CustomerName for example, that's fine, so long as it's actually unique and not repeated in the same table.

You can update your records using an update query. Have it look for fields in Table One that are Null and in that case, take the field values from Table Two. There are two things you need to look out for though: (1) if fields in both tables are Null, make sure your code handles that case (2) if both fields in both tables are not null, but have different values.