Select to view content in your preferred language

Putting a constraint on a date field

09-08-2017 01:52 PM
Occasional Contributor

I have a feature class for an asset that is going to be inspected twice a year, so it has an attribute for the date of the inspection that is going to be entered by the inspector. Is there a way that I can put a constraint on the date so that it can't be greater than the current date?

The inspectors are going to be using the Collector app on iOS and it has the ability to enter in the current date easily so I don't anticipate this being a huge problem. But I am symbolizing this layer based on the inspection date and if it's in the future it will throw things off, especially if it's far in the future.

0 Kudos
2 Replies
Occasional Contributor III

Depending on your underlying database (ie SQL Server, Oracle, ...) you can set a constraint in the database's back end.  However, I am pretty sure there isn't a tool to do it in ArcGIS itself.  I also don't know if a back end constraint will carry over to Collector.  You could use editor tracking which will auto populate the date for the user when they create or update a feature.

Occasional Contributor

We do use editor tracking, but this feature class will be edited by others at different times so I can't use that as an inspection date.  Hence the separate attribute for that.  I think you are right that Collector might not be able to pass through the error if I constrain it on the database side, I imagine it probably would cause issues there.  I do QA\QC the data before we rec & post so I'll just have to pay attention to the inspection date when we do that.  We'll be implementing Data Reviewer at some point in the future and hopefully it will be able to flag the inspection date if it's past the current date there.