Skip to main content
3 of 3
add marketing-cloud tag, source code formatting
Adam Spriggs
  • 31.1k
  • 6
  • 44
  • 88

I need an email sent on a specific date/time. Query needs to pop data ext. 1 day before date/time

I need an email sent on a specific date, my current query populates a data extension from the difference of days since the users received a particular "email id". What would be the best way to have this query populate a new data ext 1 day before the given date?

SELECT 
  EmailAddress as SubscriberKey
  , EmailAddress
  , first_name
  , last_name
  , registration_date 
FROM Wild_Spirit_12pm h 
WHERE h.EmailAddress IN (
   SELECT s.SubscriberKey   
   FROM _Sent s     
   INNER JOIN _Job j ON s.JobID = j.JobID   
   WHERE j.EmailID = '2457224'
   AND DATEDIFF(Day, s.EventDate, Getdate()) = 1) /* this is where i need it send 1 day before 6/28/16 */
Angel
  • 27
  • 1
  • 4