Compare multiple dates in one line of code

Hi all,

I have 5 variabels for which I would like to have a line of code to determine the date that is the most in the future.

Also, to that date I should add 3 days.


  • To add days: Use Datetime1.adddays(1)
  • To add months: Use Datetime1.addmonths(1)
  • To add years: Use Datetime1.addyears(1)

Thanks! Any idea how to get the maximum date out of 5 variables?

Please refer the below link.

Thanks for your reply but I did not get it and I did it via a workaround.
I wrote my variables in excel and used the MAX function and then re-stored the value as a variable for further calculations :).

1 Like


This can be easily achieved using datatable and defaultview property provided datatable column should be of date type.

Check this out:


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.