Date Constraint of 1 Year

167
3
Jump to solution
08-26-2019 10:20 AM
Highlighted
New Contributor III

Trying to put a date constraint in a Survey123 form in which a calibration date must be no more than 1 year from today (if the machine used to perform the inspection was last calibrated a year or more from today, it needs to be re-calibrated).

I've tried using several variations of a today-365 formula, as well as trying to use two calculation rows, one for mindate and one for maxdate, without success.

Any help on how to handle this would be greatly appreciated. 

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Regular Contributor

Jason‌,

You can use either (.+(1000*24*60*60*365) > today()) or (today() - . < (1000*24*60*60*365)) as your constraint in your XMLForm.  Both will check for an input date within the past 365 days.

If these do not work post what you have and someone can take a closer look.

View solution in original post

3 Replies
Highlighted
MVP Regular Contributor

Jason‌,

You can use either (.+(1000*24*60*60*365) > today()) or (today() - . < (1000*24*60*60*365)) as your constraint in your XMLForm.  Both will check for an input date within the past 365 days.

If these do not work post what you have and someone can take a closer look.

View solution in original post

Highlighted
New Contributor III

Perfect!  That worked.  Thanks!!

Reply
0 Kudos
Highlighted
Esri Notable Contributor

Jason, if you found Lance's answer to work, please remember to mark it as the correct answer.  Cheers

Reply
0 Kudos