informix
Informix Guide to SQL: Syntax
Segments

DATETIME Field Qualifier

Use a DATETIME field qualifier to specify the largest and smallest unit of time in a DATETIME column or value. Use the DATETIME Field Qualifier segment whenever you see a reference to a DATETIME field qualifier in a syntax diagram.

Syntax

Element Purpose Restrictions Syntax
digit Single integer that specifies the precision of a decimal fraction of a second. The default precision is 3 digits (a thousandth of a second). You must specify an integer between 1 and 5, inclusive. Literal Number, p. 4-237

Usage

Specify the largest unit for the first DATETIME value; after the word TO, specify the smallest unit for the value. The keywords imply that the following values are used in the DATETIME column.

Unit of Time Purpose
YEAR Specifies a year, numbered from A.D. 1 to 9999
MONTH Specifies a month, numbered from 1 to 12
DAY Specifies a day, numbered from 1 to 31, as appropriate to the month in question
HOUR Specifies an hour, numbered from 0 (midnight) to 23
MINUTE Specifies a minute, numbered from 0 to 59
SECOND Specifies a second, numbered from 0 to 59
FRACTION Specifies a fraction of a second, with up to five decimal places The default scale is three digits (thousandth of a second).

The following examples show DATETIME qualifiers:

Related Information

For an explanation of the DATETIME field qualifier, see the discussion of the DATETIME data type in the Informix Guide to SQL: Reference.


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