NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-9
DATE-TIME Functions
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.
See DATETIME Data Type
on page D-14 for more detailed information about the
contents of DATETIME fields.
DATE-TIME Functions
Date-time functions are functions you can use in expressions that involve columns
defined with the date-time data types (DATETIME, DATE, TIME, and TIMESTAMP).
You can use the date-time functions anywhere an arithmetic expression is allowed.
NonStop SQL/MP provides the following date-time functions:
For more information, see the descriptions of specific functions.
DATE-TIME Literals
A date-time literal is a DATETIME, DATE, TIME, or TIMESTAMP constant that you
can use in an expression, in a statement, or as a parameter value. Date-time literals have
the same range of valid values as the corresponding date-time data types.
DATE DATETIME YEAR TO DAY (4 bytes)
TIME DATETIME HOUR TO SECOND (3 bytes)
TIMESTAMP DATETIME YEAR TO
FRACTION(6)
(11 bytes)
CONVERTTIMESTAMP
Function
Converts a Julian timestamp to a DATETIME value
CURRENT Function Returns the current date, current time, or current date and time
DATEFORMAT Function Formats a date-time value
DAYOFWEEK Function Returns an integer representing a day of the week
EXTEND Function Adjusts the range of fields for a date-time value
JULIANTIMESTAMP
Function
Converts a date-time value to a Julian timestamp