Tuesday, September 4, 2018

Sample Functions of TO_CHAR

ParameterFormulaSample ResultExplanation
DLto_char({today},'DL')Saturday, April 02, 2016Date Long
YEARto_char({today},'YEAR')TWENTY SIXTEENYear, spelled out
YYYYto_char({today},'YYYY')20164-digit year
YYYto_char({today},'YYY')016Last 3, 2, or 1 digit(s) of year.
YYto_char({today},'YY')16
Yto_char({today},'Y')6
IYYto_char({today},'IYY')016Last 3, 2, or 1 digit(s) of ISO year.
IYto_char({today},'IY')16
Ito_char({today},'I')6
IYYYto_char({today},'IYYY')20164-digit year based on the ISO standard
Qto_char({today},'Q')2Quarter of year (1, 2, 3, 4; JAN-MAR = 1).
MMto_char({today},'MM')04Month (01-12; JAN = 01).
MONto_char({today},'MON')APRAbbreviated name of month.
MONTHto_char({today},'MONTH')APRILName of month, padded with blanks to length of 9 characters.
RMto_char({today},'RM')IVRoman numeral month (I-XII; JAN = I).
WWto_char({today},'WW')14Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year.
Wto_char({today},'W')1Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh.
IWto_char({today},'IW')13Week of year (1-52 or 1-53) based on the ISO standard.
Dto_char({today},'D')7Day of week (1-7).
DAYto_char({today},'DAY')SATURDAYName of day.
DDto_char({today},'DD')02Day of month (1-31).
DDDto_char({today},'DDD')093Day of year (1-366).
DYto_char({today},'DY')SATAbbreviated name of day.
Jto_char({today},'J')2457481Julian day; the number of days since January 1, 4712 BC.
HHto_char({today},'HH')01Hour of day (1-12).
HH12to_char({today},'HH12')01Hour of day (1-12).
HH24to_char({today},'HH24')01Hour of day (0-23).
MIto_char({today},'MI')22Minute (0-59).
SSto_char({today},'SS')46Second (0-59).
SSSSSto_char({today},'SSSSS')4966Seconds past midnight (0-86399).
How helpful was this answer?

No comments:

Post a Comment