I am using DateDiff(DateInterval.Day, todaysDate, taskDate)
where todaysDate variable gets Today’s date in DateTime format and taskDate gets date from an excel sheet in DateTime format
I want to see if a task has been updated from last 5 days or not.
Please help.
Hi @Nikhil_kathpalia ,
Did you mean to say that you are getting negative values?

If so, then you could use a Math.Abs like so:

Math.Abs(DateDiff(DateInterval.Day,today,today.AddDays(-1)))
Kind Regards,
Ashwin A.K
I am getting this compiler error
ppr
(Peter Preuss)
5
just inspect the datatype of your variable which gets assigned from the statement
maybe you are looking for this:

1 Like
Hi @Nikhil_kathpalia ,
Somehow I get the feeling that you have placed this inside of an If Activity.
If that is the case, then could you try this?
Math.Abs(DateDiff(DateInterval.Day,today,today.AddDays(-1)))<5
Kind Regards,
Ashwin A.K
1 Like
This worked, Thanks a lot!!
1 Like
ppr
(Peter Preuss)
8
kindly note:

a future date will be kept as same as an 2 days old day with the Math.Abs approach
1 Like
system
(system)
Closed
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.