Skip to main content
Nintex Community Menu Bar
Solved

How to validate that end date is greater than start date

  • August 10, 2015
  • 4 replies
  • 1117 views

Forum|alt.badge.img+4

I have two date fields: Start date and End Date. I am trying to find a way to validate that the end date is greater than or equal to the start date. If I used datediff, it gives me the number of days difference between the two dates, but only as a positive number (e.g. 1/8/2015 & 4/8/2015 = 3; 4/8/2015 & 1/8/2015 = 3, so using this to catch where the second example would normally be -3!!

 

I have looked everywhere to try and find a simple solution....HELP!!!

Best answer by patrick_hosch

this is caused by having the first date in the function as the end date. turn the dates in the function around: dateDiffDays(StartDate,EndDate)

4 replies

Forum|alt.badge.img+6
  • Nintex Employee
  • August 11, 2015

Hi Michael Campbell​, not sure why it doesn't show -3 (or any other negative value). i have just tried this using the DateDiffDays and DateDiffSeconds functions and both work as expected. I get negative values in case the end date is before the start date. can you share a screenshot?


Forum|alt.badge.img+4
  • Author
  • August 11, 2015

DateDiffIssue.PNG

The 8 should be displayed as -8?? My Formula field is dateDiffDays(EndDate,StartDate)


Forum|alt.badge.img+6
  • Nintex Employee
  • Answer
  • August 12, 2015

this is caused by having the first date in the function as the end date. turn the dates in the function around: dateDiffDays(StartDate,EndDate)


Forum|alt.badge.img+5
  • August 1, 2016

DateDiffDays return positive values only, to validate the date use greaterThan function instead.