How To: Build a SQL query based on a date field to select all records where the date is within the next 30 days
Instructions provided describe how to build a SQL query for use in the ArcMap Select By Attributes dialog box to select all records in a date field within the next 30 days.
Data must reside in a personal geodatabase for the syntax of this query to work, as it is based on Microsoft Access SQL query syntax.
Enter the following query:
[FIELD_NAME] between Date () and DateAdd ( "d", 30, Date())
FIELD_NAME, in the above example, is the name of the date field.
This selects all records in the designated field that are between the current date and the current date with 30 added to the day.
Last Published: 5/5/2016
Article ID: 000009930
Software: ArcGIS-ArcEditor 9.3.1, 9.3, 9.2, 10 ArcGIS-ArcInfo 9.3.1, 9.3, 9.2, 10 ArcGIS-ArcView 9.3.1, 9.3, 9.2, 10