Skip to main content
Nintex Community Menu Bar

Question about dateDiffDays

  • Aug 7, 2017 12:20 PM UTC
  • 6 replies
  • 23 views
  • Translate All

Forum|alt.badge.img+8

I'm apparently doing this wrong. I'm trying to add a validation rule on a date picker that says If Choice A is picked for control named choiceLetter,  check if the date selected is more than 120 days PREVIOUS to Current Date, and if it's true then the date is invalid. I can't even get the date rule working regardless of choiceLetter control. Is the below validation rule not correct? It seems like regardless of the date selected it fails the validation.

or(dateDiffDays({Self}, Current Date) < 120, {Self} < Current Date)‍‍‍

6 replies

Forum|alt.badge.img+8
  • Author
  • Aug 7, 2017 3:18 PM UTC

I've also tried making a calculated value of:

dateAddDays(Current Date, -120)‍

and then in the control properties of the date control, comparing it to the calculated value above, saying if Less than or equal, give error message but I think because I'm getting the returned value of "Sunday, April 9, 2017 12:00:00 AM" in the CV, the date picker can't validate against it. It doesn't seem to apply the validation at all in this case.

Translate

Forum|alt.badge.img+9

Hi ,

The below validation rule is working fine. And also i have added a calculated value which will show the difference of days count.

dateDiffDays(Current Date,ReleaseDate) > 120

206348_pastedImage_1.png206349_pastedImage_2.png

Thanks,

‌

Translate

Forum|alt.badge.img+8
  • Author
  • Aug 8, 2017 12:43 PM UTC

Yea, that's a problem. I'm trying that same string and it's not working. This is on a completely new form and list. I also tried swapping dateDate and Current Date but no change. 

dateDiffDays(dateDate,Current Date) > 120

Translate

Forum|alt.badge.img+9

I hope you are using named controls only in validation rule, May i know which version you are using?

Translate

Forum|alt.badge.img+14
  • Scholar
  • Aug 13, 2017 10:12 PM UTC

if you input whatever past date your condition evaluates to true since 2nd expression evaluates to true. that's why validation dos not pass through.

if you want to check if date is older then 120 days, first expression should be enough.

Translate

Forum|alt.badge.img+14
  • Scholar
  • Aug 13, 2017 10:12 PM UTC

that's a validation error on Title mandatory field, not on date validation...

Translate