Date Constraint of 1 Year

687
3
Jump to solution
08-26-2019 10:20 AM
JasonCyphers
Occasional 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. 

0 Kudos
1 Solution

Accepted Solutions
LanceCole
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
LanceCole
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.

JasonCyphers
Occasional Contributor III

Perfect!  That worked.  Thanks!!

0 Kudos
KoryKramer
Esri Community Moderator

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

0 Kudos