SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
D-15
DATETIME Data Type
DATETIME Data Type
An item of data type DATETIME represents a point in time. It can include a date, a
time, or a date and time.
start-field
specifies the first field for a range of DATETIME fields.
end-field
specifies the last field for a range of DATETIME fields, or the only field for a
single-field DATETIME item.
precision
is an unsigned integer in the range 1 through 6 that specifies the number of
significant digits with which to express the fraction of a second for end-field.
Considerations—DATETIME DATA TYPE
A specific DATETIME data type is compatible only with another DATETIME data
type that has the same range of DATETIME fields, or with the equivalent DATE,
TIME, or TIMESTAMP data type.
For example, these pairs are compatible data types:
DATETIME YEAR TO DAY and DATE
DATETIME HOUR TO SECOND and TIME
DATETIME YEAR TO FRACTION(6) and TIMESTAMP
These three data types are NOT compatible, although they are all DATETIME data
types:
DATETIME YEAR TO DAY
DATETIME YEAR TO FRACTION(6)
DATETIME HOUR
DATETIME [ start-field TO ] end-field
start-field and end-field are:
{ YEAR }
{ MONTH }
{ DAY }
{ HOUR }
{ MINUTE }
{ SECOND }
{ FRACTION precision }
start-field must precede end-field and only end-field can
include the precision option.