Date, time, and timestamp literals are date, time, and timestamp values surrounded by a standard prefix and suffix. Date literals are specified in a YYYY-MM-DD format. Time literals are specified in an HH:MM:SS format with an optional fraction component. Timestamp literals are a concatenation of date and time values.
Examples for ODBC and SQL syntax are shown in the following table.
Table 63. Time and Date Literals
Literal Type
ODBC Syntax
ANSI SQL-92 Syntax
Date Literal
{d ’1999-09-19’}
date ’1999-09-19’
Time Literal
{t ’11:11:11.225’}
time ’11:11:11.225’
Timestamp Literal
{ts ’1999-09-19 11:11:11.225’}
timestamp ’1999-09-19 11:11:11.225’
Timestamp Literal
{ts ’1999-09-19’}
timestamp ’1999-09-19’
Note: ODBC 1.x style ODBC escape sequences such as the following are not supported: --(*VENDOR(Microsoft), PRODUCT(ODBC) ...*)--