SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)
SQL/MX Functions and Expressions
HP NonStop SQL/MX Release 3.2 Reference Manual—691117-001
9-188
TO_CHAR(<DATETIME>) Function
J Returns Julian day;
the number of days
since January 1,
4712 BC.
31-MAR-11
05.02.31.123457 AM
‘J’ ‘2455652’
MI Returns minutes (0-
59)
31-MAR-11
05.02.31.123457 AM
‘MI’ ‘02’
MM Returns month (01-
12; January = 01)
31-MAR-11
05.02.31.123457 AM
‘MM’ ‘03’
MON
mon
Mon
Returns the
abbreviated name of
month in uppercase,
lowercase, or
capitalized based on
the case of the
element.
31-MAR-11
05.02.31.123457 AM
‘MON’
‘mon’
‘Mon’
‘MAR’
‘mar’
‘Mar’
MONTH
month
Month
Returns the name of
month month in
uppercase,
lowercase, or
capitalized based on
the case of the
element, padded
with blanks to
display width of the
widest name of a
month.
31-MAR-11
05.02.31.123457 AM
‘MONTH’
‘month’
‘Month’
‘MARCH’
‘march’
‘March
RM Returns the month
in roman numerals (I
to XII).
31-MAR-11
05.02.31.123457 AM
‘RM’ ‘III’
RR
RRRR
Returns the last two
or four digits of the
year.
31-MAR-11
05.02.31.123457 AM
‘RR’
‘RRRR’
‘11’
‘2011’
SS Returns seconds (0-
59)
31-MAR-11
05.02.31.123457 AM
‘SS’ ‘31’
SSSSS Returns seconds
past midnight (0-
86399).
31-MAR-11
05.02.31.123457 AM
‘SSSSS’ ‘18151’
X Returns the local
radix character. The
‘.’ (dot) is the only
supported local
radix character.
31-MAR-11
05.02.31.123457 AM
‘HH:MM:SS
XFF’
‘05:03:31.12
3457’
Element Description
datetime-
expression
format-
value Output










