informix
Informix Guide to SQL: Syntax
Segments

Literal DATETIME

The literal DATETIME segment specifies a literal DATETIME value. Use the literal DATETIME segment whenever you see a reference to a literal DATETIME in a syntax diagram.

Syntax

Element Purpose Restrictions Syntax
dd Day expressed in digits You can specify up to 2 digits. Literal Number, p. 4-237
f Decimal fraction of a second expressed in digits You can specify up to 5 digits. Literal Number, p. 4-237
hh Hour expressed in digits You can specify up to 2 digits. Literal Number, p. 4-237
mi Minute expressed in digits You can specify up to 2 digits. Literal Number, p. 4-237
mo Month expressed in digits You can specify up to 2 digits. Literal Number, p. 4-237
space Space character You cannot specify more than 1 space character. The space character is a literal value that you enter by pressing the space bar on the keyboard.
ss Second expressed in digits You can specify up to 2 digits. Literal Number, p. 4-237
yyyy Year expressed in digits You can specify up to 4 digits. If you specify 2 digits, the database server uses the setting of the DBCENTURY environment variable to extend the year value. If the DBCENTURY environment variable is not set, the database server uses the current century to extend the year value. Literal Number, p. 4-237

Usage

You must specify both a numeric date and a DATETIME field qualifier for this date in the Literal DATETIME segment. The DATETIME field qualifier must correspond to the numeric date you specify. For example, if you specify a numeric date that includes a year as the largest unit and a minute as the smallest unit, you must specify YEAR TO MINUTE as the DATETIME field qualifier.

The following examples show literal DATETIME values:

The following example shows a literal DATETIME value used with the EXTEND function:

Related Information

For discussions of the DATETIME data type and the DBCENTURY environment variable, see the Informix Guide to SQL: Reference.

For a discussion of customizing DATETIME values for a locale, see the Informix Guide to GLS Functionality.


Informix Guide to SQL: Syntax, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved