Need help with duplicates/merge query

K

Keith

I need a little help understanding how to run a query
against a Master database and identify all duplicates,
then delete the duplicates before merging the other
records into my Master database. I am not extremely
proficient in Access so any help is appreciated. Here's
my application:

We are running a number of email campaigns and have a
Master List of contacts that have recieved a mailer from
us. We are constantly acquiring new list of email
addresses, but need to remove any duplicates prior to
sending a mailer and merging the new contacts into the
Master List. I need someway to perform this query.

Thanks for the help!

Keith
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Assuming that you are putting the acquired list in a table and then
comparing that table against your Master table:

DELETE *
FROM new_table
WHERE email_address IN (SELECT email_address FROM master_table)

You can also just append the new data into the master_table like this
(untested):

INSERT INTO master_table ( < the list of columns in master_table > )
SELECT < the list of columns in new_table >
FROM new_table AS N LEFT JOIN master_table As M
ON N.email_address = M.email_address
WHERE M.email_address IS NULL

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQdmfAIechKqOuFEgEQLslgCggVF7KRx3UeDzJO6sqVcm/uqp1rEAn2oL
mHhK9emwSX5S9XM/GxQuminA
=4zYH
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top