SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
D-9
Date-Time Data Types
Date-Time Data Types
An item of a date-time data type represents a point in time. It can include a date, a
time, or a date and time. There are four date-time data types:
DATETIME
DATE
TIME
TIMESTAMP
The term “date-time data type” refers to all four of these data types. The term
“DATETIME data type” refers only to the first of these data types.
The DATETIME data type has a range of logically contiguous fields in this order:
YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, and FRACTION. A specific
DATETIME data type has a subset or range of these fields, and a specified number of
significant digits for the FRACTION field. For example:
DATETIME YEAR TO MONTH
DATETIME DAY TO FRACTION(3)
Each of the other date-time data types is equivalent to a specific range of DATETIME
fields:
A specific date-time data type is compatible only with another date-time data type that
has the same range of fields.
For more information about the contents of DATETIME fields, see DATETIME Data
Type on page D-15.
DATE DATETIME YEAR TO DAY (4 bytes)
TIME DATETIME HOUR TO SECOND (3 bytes)
TIMESTAMP DATETIME YEAR TO FRACTION(6) (11 bytes)