Problem using DateDiff


#1

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!


#2

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)


#3

Hi,

what is the DateInterval, Please refer below statements to get difference between dates,
Hope this will help you to understand.

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