Frequently asked question

What is the proper SQL syntax for date field queries in ArcGIS?

Last Published: April 26, 2020
The SQL syntax for querying date fields varies according to DBMS. Unfortunately it can vary widely, even though SQL is the standard and most popular DBMSs use for queries. The following examples should be helpful:

Personal Geodatabases:
[DATE_FIELD] = #1970/8/17# 
[DATE_FIELD] = DateSerial(1970,8,17) 

Coverages, shapefiles and SDE geodatabases comply with SQL standards:
"DATE_FIELD" = date '1970/8/17'

Data formats and SQL syntax for some DBMSs or versions of DBMSs may be different than what is shown above. For more information, check the Select by Attributes dialog box by clicking either Help or the SQL Info button.

Article ID: 000012736

Software:
  • ArcMap 8 x
  • ArcMap 9 x
  • Legacy Products

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options