SQL/MP Installation and Management Guide

Creating a Database
HP NonStop SQL/MP Installation and Management Guide523353-004
5-23
Defining Columns
Defining Date-Time and Time Interval Data
The data types for date-time data are:
The data type for time interval data is as follows:
Columns of the DATETIME, DATE, TIME, TIMESTAMP, and INTERVAL data types
contain information about dates, times, and time intervals. A comparison of these data
types follows, denoting in each case the data type, its meaning, and the range of data
allowed in fields of a value of this type. The fields in these data types are not
equivalent to columns.
A column value of type DATETIME is made up of any subset of these contiguous
fields:
YEAR Year 1 to 9999
MONTH Month of year 1 to 12
DAY Day of month 1 to 31 (maximum value
depends on length of
month)
HOUR Hour of day 0 to 23
MINUTE Minute of hour 0 to 59
SECOND Second of minute 0 to 59
FRACTION Fraction of second 0 to 0.9(n) in
which n is the precision.
The maximum precision is 6;
the default is 6.
A DATETIME column is defined to have a range of these contiguous fields, specified
by an optional start-date-time field and a required end-date-time field. You cannot
include the FRACTION precision in the start-date-time specification.
A column value of type DATE is made up of these contiguous fields:
YEAR Year 1 to 9999
MONTH Month of year 1 to 12
DAY Day of month 1 to 31
The DATE data type is equivalent to DATETIME YEAR TO DAY. The maximum value
of DAY depends on the length of the month.
DATETIME Date and time data, optionally including specific time
periods
DATE Date only data
TIME Time only data
TIMESTAMP Date and time data
INTERVAL Duration of time