Hey Im hoping somone here can help me out...

Heres what Im trying to do:

I have in the Results table the email addresses of prospects and the dates they 
signeed onto the list,
In tblFollowUpEmails I have a message that will go out so many days 
(followUpEmailDelay) after signing up

what im getting at is can someone help me put this together into one query that will 
pull out the results
based on the automated responce that they should get for that day. 

Below has the logic, but how can I make this work as one query any help is 
apretiated...

Thanks

-Pual



<cfquery name="qs_GetFollowUps" datasource="#dsn#">
SELECT      FollowUpEmailID, CustomerID, FollowUpEmailDelay, FollowUpEmailSubject, 
FollowUpEmailMessage, FollowUpEmailTitle, ocid
FROM         tblFollowUpEmails
</cfquery>
<cfoutput query="qs_GetFollowUps">
<cfset adjustedDate=#DateAdd("d", -#FollowUpEmailDelay#, #DateFormat(Now())#)#>
<cfquery name="qs_GetResultEmail" datasource="#dsn#">
SELECT      rid, ocid, email, date
FROM         Results
WHERE (Email <> 'remove') and (ocid='#ocid#') and (date=#createodbcdate(adjustedDate)#)
</cfquery>
</cfoutput>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to