How I can check if a date is less that 5 years appart from another date?

Hello, I am new here and I would like some help regarding the comparison of 2 dates, I would be very grateful if I would get an answer for this question
Thank you very much!

You can use DateDiff method to achieve this.

This page describes the various options available for this method, with easy examples.

If Interval is set to DateInterval.Year, the return value is calculated purely from the year parts of Date1 and Date2. Similarly, the return value for DateInterval.Month is calculated purely from the year and month parts of the arguments, and for DateInterval.Quarter from the quarters containing the two dates.

I hope this helps.
Happy automation!

Hi,

I am attaching a workflow which will calculate the difference of wo dates and tell you whether difference is less or greater than 5 years.DateDifference.xaml (4.7 KB)

1 Like