SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Release 3.2 Reference Manual691117-001
9-4
Datetime Functions
Datetime Functions
These functions use either a datetime value expression as an argument or return a
result of datetime data type:
CONVERTTIMESTAMP Function on
page 9-36
Converts a Julian timestamp to a TIMESTAMP
value.
CURRENT Function
on page 9-40 Returns the current timestamp. You can also use
the CURRENT_TIMESTAMP Function
.
CURRENT_DATE Function
on
page 9-41
Returns the current date.
CURRENT_TIME Function
on
page 9-42
Returns the current time.
CURRENT_TIMESTAMP Function
on
page 9-43
Returns the current timestamp. You can also use
the CURRENT Function
.
DATE_ADD Function
on page 9-44 Adds an interval specified by an
interval_expression to a datetime_expression.
DATEADD Function
on page 9-44 Adds a time interval specified by a datepart and
num_expression to a datetime_expression.
DATE_SUB Function
on page 9-48 Subtracts an interval_expression from a
datetime_expression.
DATEDIFF Function
on page 9-46 Returns the integer value for the number of
datepart unit boundaries of time crossed
between startdate and enddate.
DATEFORMAT Function
on page 9-48 Formats a datetime value for display purposes.
DAY Function
on page 9-50 Returns an integer value in the range 1 through
31 that represents the corresponding day of the
month. You can also use DAYOFMONTH.
DAYNAME Function
on page 9-51 Returns the name of the day of the week from a
date or timestamp expression.
DAYOFMONTH Function
on page 9-52 Returns an integer value in the range 1 through
31 that represents the corresponding day of the
month. You can also use DAY.
DAYOFWEEK Function
on page 9-53 Returns an integer value in the range 1 through 7
that represents the corresponding day of the
week.
DAYOFYEAR Function
on page 9-54 Returns an integer value in the range 1 through
366 that represents the corresponding day of the
year.
EXTRACT Function
on page 9-75 Returns a specified datetime field from a
datetime value expression or an interval value
expression.