I have a survey which records the date when a record is created.
Would it be possible to somehow have a dynamic field which is parsed at run time to record either a 1 or 0 to see whether the record was made today? Obviously If this was calculated when the record was calculated it would be always 1.
Hi Robert,
This can be done in a couple of ways.
If you need new records in the past 24 hours, look at the DateDiff function and use a if/else block to assign 1/0 based on that: Date Functions | ArcGIS for Developers
If you need to match the exact date, I would use the Day(), Month(), and Year() functions to compare the values to today:
var today = Now();
var theDate = Date($feature.CreationDate);
if (Day(today) == Day(theDate) && Month(today) == Month(theDate) &&Year(today) == Year(theDate)) {
return 1;
}
return 0;