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,
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

3 Likes