Skip to main content
Nintex Community Menu Bar
Solved

How to validate that end date is greater than start date

  • Aug 10, 2015 9:50 PM UTC
  • 4 replies
  • 1179 views
  • Translate All

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)

View original

4 replies

Forum|alt.badge.img+6
  • Nintex Employee
  • Aug 11, 2015 2:26 PM UTC

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?

Translate

Forum|alt.badge.img+4
  • Author
  • Aug 11, 2015 9:48 PM UTC

DateDiffIssue.PNG

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

Translate

Forum|alt.badge.img+6
  • Nintex Employee
  • Answer
  • Aug 12, 2015 8:33 AM UTC

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)

Translate

Forum|alt.badge.img+5
  • Nintex Partner
  • Aug 1, 2016 12:51 PM UTC

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

Translate