Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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… – Kirk Kuykendall Dec 21 '12 at 4:54

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

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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