cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
nj
Nintex Newbie

Question about dateDiffDays

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)‍‍
0 Kudos
Reply
6 Replies
nj
Nintex Newbie

Re: Question about dateDiffDays

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.

0 Kudos
Reply
lakshminarayana
Nintex Newbie

Re: Question about dateDiffDays

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

Thanks,

0 Kudos
Reply
nj
Nintex Newbie

Re: Question about dateDiffDays

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

0 Kudos
Reply
lakshminarayana
Nintex Newbie

Re: Question about dateDiffDays

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

0 Kudos
Reply
Automation Master
Automation Master

Re: Question about dateDiffDays

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.

0 Kudos
Reply
Automation Master
Automation Master

Re: Question about dateDiffDays

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

0 Kudos
Reply