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!

Remove Duplicates from DTS email shot 1

Status
Not open for further replies.

panini

MIS
Jun 1, 2001
136
GB
Hi there,

I have a number of email shots that go out to customers each night reminding of other services they may want to purchase from us.

I have an unsubscribe database that gets queried to stop any unsubs getting mailed.

My problem is, potentially I could have someones email address in more than one customer table and I don't want to email them more than once - does anyone have any idea how i might approach this?

I am using an active x script in a scheduled DTS package that uses cdosys to send an asp page as an html email - hence pulling the customer details from the relevant database as the page is called by the script.

I hope that makes sense!

Many Thanks,
 
Can you pull together all the email addresses to receive the email into a temporary table then do a select distinct (email_address) from this temp table.

Something like

CREATE TABLE #TEMP (email varchar(50))
INSERT INTO #TEMP
SELECT email FROM tableA WHERE whatever
UNION
SELECT email FROM tableB WHERE Whatever
UNION
SELECT etc

SELECT DISTINCT(email)
FROM #TEMP

DBomrrsm
 
cool - i'll try that - thanks for answering so quickly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top