Problem using DateDiff

Hello,

I am using the expression

DateDiff(DateInterval, Date1, Date2)

in an if activity in order to check a period and a message appears:
DateDiff is a type and can not be used as an expression

What could I do?

Thanks a lot!

Can you not take one datetime variable away from the other to pre-calculate the period? If not (I havenβt checked), I would probably do it this way; although there is probably a more straightforward way.

Compare_Dates.xaml (9.9 KB)

2 Likes

Hi,

what is the DateInterval, Please refer below statements to get difference between dates,

DateDiff(βsβ, Now, Now + 1) =86400
DateDiff(βnβ, Now, Now + 1) =1440
DateDiff(βhβ, Now, Now + 1) =24
DateDiff(βdβ, Now, Now + 1) =1
DateDiff(βmβ, Now, Now + 60) =2
DateDiff(βyyyyβ, Now, Now + 365) =1
DateDiff(βyβ, Now, Now + 10) =10
DateDiff(βqβ, Now, Now + 365) =4
DateDiff(βwwβ, Now, Now + 365) =52
DateDiff(βwβ, Now, Now + 365) =52
DateDiff(βdβ, Now + 1, Now) =-1

3 Likes