Dynamic date filtering on layer from sql local server problem

509
0
07-04-2017 12:19 AM
SPNIOrganization
Occasional Contributor

Hi,

I have a layer on a local sql 2008 r2 server. The layer is presented on an arcgis online web map and I want to dynamically filter it by the date field, so it will not show the last week observations.

I've tried to work by this tutorial - Dynamic Date Filter  , and trough the AGOL Assistant to change the definitionExpression with a variety of expressions,  and each time it's show an error - "Data access failed".

there's some of the expressions I've treied (with or without brackets, with CURRENT_TIMESTAMP,  CURRENT_DATE or the GETDATE expressions):

 "definitionExpression": "ObsDate NOT BETWEEN CURRENT_TIMESTAMP - 7 AND CURRENT_TIMESTAMP"
"definitionExpression": "ObsDate < CURRENT_TIMESTAMP - 7"
"definitionExpression": "ObsDate BETWEEN convert(date, GETDATE()-7) AND convert(date, GETDATE())"

Any ideas?

Thanks,

Gil.

0 Replies