English

FAQ: Can ArcMap execute queries based on date and time values in Oracle Date fields?

Question

Can ArcMap execute queries based on date and time values in Oracle Date fields?

Answer

Yes. Oracle provides a TO_DATE function. Use the TO_DATE function in the Select by Attribute dialog box to format date strings into date literals. The syntax for this function is:

Code:
TO_DATE(string[,'format'])

Below is an example of a properly formatted WHERE clause. This will select all records having a date/time >= 12/20/2004 2:00 PM:

Code:
MYDATE >= TO_DATE('2004-12-20 14:00:00 ','YYYY-MM-DD HH24:MI:SS')

Oracle supports a wide variety of date/time formats for query and display purposes. Consult the Oracle documentation for further information on formatting dates and times.

Related Information