0

Goal is to find rows where the date is exactly 30 days from today.

Source is a Salesforce Date/Time field from a Synchronised Data Extension and posted to a regular Data Extension to Date attribute. Should be simple enough..

The values are in the following format:

Saturday, July 10, 1965 12:00 AM

This otherwise valid query doesn't return any results:

WHERE a.DateTimeField = DateAdd(day,30,cast(GetDate() as date))

This one also doesn't return any results:

CONVERT(date, a.DateTimeField) = CONVERT(date, DATEADD(day,+30, GETDATE()))

And this one returns results +29 days and +30 days:

DATEPART(DAYOFYEAR, DateField) = DATEPART(DAYOFYEAR,(getUTCDate()+30))

Anyone have any ideas what else to try?

  • Please check if the answers in this post can help : salesforce.stackexchange.com/questions/209157/… – Shamina Jul 9 at 17:28
  • Are timezones an issue for you or is "about 30 days" good enough? – Macca Jul 9 at 23:17
  • Shamina - thank you, but no luck with that. @Macca - ideally if there is a way to solve the timezone issue, it would be great. However since source data is already in Synch DE in it's own format, it would be fine to have just the rows with correct amount of days retrieved from it. – Rain Jul 10 at 8:18

Your Answer

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

Browse other questions tagged or ask your own question.