HOW TO
Instructions provided describe how to work with date values, in a string field, in a format specified. By default, dates in Arcview are represented by an 8-digit number in the format of YYYYMMDD.
Code:
[Date].SetFormat( "M, d, yyyy").AsString
Code:
[Date].SetFormat("M, d, yyyy").AsString
Code:
[Date].SetFormat("yyyy").AsString
Code:
[Date].SetFormat("MMM dd, yyy").AsString
Note:
For more information on the various date formats, see the help topic 'Dates.'
Note:
If there is a single field, and a different format is desired,
use the SetFormat request on that field.
Note:
To perform a query on dates contained in the String field, set the default date format to the format used for the date String field.
1. Open a new Script Window.
2. Copy the following line of code to the window, which may vary depending on the date format specified.
Code:
Date.SetDefFormat("M/d/yyyy").AsString
Code:
( [Date_String].AsDate >= "12, 03, 1996".AsDate)
Code:
( [Date_String].AsDate > "1972".AsDate)
Note:
The AsDate request will create a date object from the string value.
Article ID:000004038
Get help from ArcGIS experts
Download the Esri Support App