0

I have the following check in my query

[Event:Start_Date_and_Time__c] >= DateAdd(day, 2,cast(GetDate() as date))

But the problem is that if the event was created on 08/19/22 5:00 am, and the time at which this query is running is 08/19/22 10:00 am, then this entry will still fall under these conditions, but this is not correct. How it is possible to make this check more correctly?

1
  • You are getting rid of the timestamp and adding 2 days to the current date, so the Start_Date_and_Time__c would have to be 2 days from now in the future for this to evaluate to true, is this what you are trying to do?
    – zuzannamj
    Aug 19, 2022 at 10:07

1 Answer 1

2

I am not sure I fully understand what you are trying to achieve, but the issue you are running into might be related to the fact that in the Start_Date_and_Time__c column you have timestamps, and you are comparing them to dates. Try this instead:

cast([Event:Start_Date_and_Time__c] as date) >= DateAdd(day, 2,cast(GetDate() as date))
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .