Dynamic Date in hosted feature layer

849
1
05-15-2019 02:08 AM
GillPaterson
New Contributor III

In ArcGIS Portal I have a number of Hosted Feature Layers published through GeoEvent with the data in ArcGIS DataStore. I would like to filter these layers using a dynamic date filter, eg only show features that have an update date within the last 1 or 24 hours.

I found this dynamic date filter doc which was very helpful, however in Portal (10.6.1) it only seems to take simple date expressions, not anything to do with hours. I can get "definitionExpression": "cdts > (CURRENT_DATE - 1)" to work with any number of days. The field type is listed as Date, and the field shows Date/Time information. Is there an example of an expression that calculates the difference in time for ArcGIS Data Store? I have tried the following with no luck...

updated > DATEADD(day, 1, GETDATE())  - I thought I would try sql just in case it worked.

updated > DATEADD(hour, 1, GETDATE())  - I thought I would try sql just in case it worked.
updated > (CURRENT_DATE - INTERVAL '2 days')
updated > (timestamp(now()) - interval '2 days')

updated > (timestamp(now()) - interval '2 hours')
timestamp(updated) > (CURRENT_TIMESTAMP - interval '2 days')
timestamp(updated) > (CURRENT_TIMESTAMP - interval '12 hours')

Any other hints or suggestions??

0 Kudos
1 Reply
GillPaterson
New Contributor III

The answer can be found here... Querying Feature Services: Date-Time Queries 

0 Kudos