1

I used for dateadd function for above requirement i got the data in my dataextension. Could please give me any suggestion for achieve this requirement. I tried following code for below requirement could please review my code.

   Select Id, departure_date__c,Booking_date__c from Reservation_DE 
   where Booking_date__c <=DATEADD(day, +30,departure_date__c)
1

I attempted something similar - wanted to add people exactly 28 days before they go to an event. Had to expand the DateAdd a bit to get the date component, and this works:

SELECT * 
FROM DE_NAME
WHERE ([arrivalDate] >= DATEADD(DAY, 30, CAST(GETDATE() AS date))) 

optional...

SELECT * 
FROM DE_NAME
WHERE ([arrivalDate] >= DATEADD(DAY, 30, CAST(GETDATE() AS date)) 
AND [arrivalDate] < DATEADD(DAY, 31, CAST(GETDATE() AS date)))
| improve this answer | |
3

Almost there . Your code will return information 30 days after the departure_date__c. Change +30 to -30.

SELECT Id
, departure_date__c
,Booking_date__c 
FROM Reservation_DE 
WHERE Booking_date__c <=DATEADD(day, -30,departure_date__c)

Reference:

| improve this answer | |
  • Thank you for providing information and official document. – UserSFMC Feb 2 '18 at 12:37

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.