0

I wrote a query to update a field inside a target Data Extension. The query will set the field to True when a subscriber has received an email within three days. The field has a default value of False.

Problem: The query is setting the field inside the target DE to false. How can i update the field inside the Target DE. Here is the query below:

Select [Email Address] as [Email Address], contact_three_days as 'True' from initial_emailing_list 

WHERE [Email Address] NOT IN 

(SELECT SubscriberKey FROM _Sent WHERE EventDate >= DATEADD(DAY, -3, GETDATE())) 
0

Give this a try. If you use 'as' in your select statement then it's renaming you field, not the value. Hard code the value using =

Select
 [Email Address] as [Email Address],
 contact_three_days =  'True' 
 from initial_emailing_list 
WHERE [Email Address] NOT IN (SELECT SubscriberKey FROM _Sent WHERE EventDate >= DATEADD(DAY, -3, GETDATE())) 
2
  • Set the action to update rather the overwrite the target data extension. Nov 5 '18 at 22:41
  • Thank you @iManage. I need to make edit to my query so that it will give me a Data Extension that is a copy of the Source DE, but has the contact_three_days field set to true for all relevant fields.
    – Nat Fan
    Nov 5 '18 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.