5

I am current trying to do layer definitions on a map and so I am trying to filter some records via a time factor so i was writing in the Where field DATE_CLOSED_ON > (CURRENT_TIME - 24) and DATE_CLOSED_ON is not NULL

enter image description here

I believe that in order to query a date field there is a must to include the field is not null. As for the time factor I am trying to query records that are closed less than 24 hours ago but the query keep returning me all records with a non null DATE_CLOSED_ON field.

  • 2
    Which ArcGIS product and version is your screenshot and issue from? It may be worth updating your tag(s) to that. – PolyGeo Dec 20 '12 at 10:20
  • I am using arcgis 10.0, its not an issue but just what is the syntax for getting records less than 24 hours. – jonleech Dec 21 '12 at 0:47
  • Is it ArcGIS Server? Is it from one of the ArcGIS Viewers? If so, which one? I could investigate the ArcGIS Desktop equivalent but your screenshot does not look like it comes from there. – PolyGeo Dec 21 '12 at 0:51
  • ArcGIS Server and I am using the REST services. http://localhost/arcgis/rest/services/... you get the idea.. – jonleech Dec 21 '12 at 0:58
  • See my related question gis.stackexchange.com/questions/41216/… – Kirk Kuykendall Dec 21 '12 at 4:54
1

The syntax depends on the underlying database. Assuming that it is sql server:

DATE_CLOSED_ON >= DATEADD(day, -1, getdate())

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.