23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Time formats<br />

Time formats<br />

194<br />

A time format string can contain any of the following format keywords along with other<br />

characters. The format keywords in the format string are replaced by corresponding values to<br />

get the result. The other characters are displayed as literals.<br />

Table 47 lists the time formats and their corresponding descriptions.<br />

Table 47: Time formats and descriptions<br />

Time<br />

format Description<br />

AM<br />

PM<br />

A.M.<br />

P.M.<br />

The string AM or PM depending on whether time corresponds to morning or<br />

afternoon<br />

The string A.M. or P.M. depending on whether time corresponds to morning or<br />

afternoon<br />

HH12 The hour value as a two-digit number (in the range 00 to 11)<br />

HH<br />

HH24<br />

The hour value as a two-digit number (in the range 00 to 23)<br />

MI The minute value as a two-digit number (in the range 00 to 59)<br />

SS The seconds value as a two-digit number (in the range 00 to 59)<br />

SSSSS The seconds from midnight as a five-digit number (in the range 00000 to<br />

86399)<br />

MLS The milliseconds value as a three-digit number (in the range 000 to 999)<br />

Example The following example illustrates the TO_CHAR function, and the Day, Month, dd, and HH12 format<br />

strings:<br />

SELECT C1 FROM T2;<br />

C1<br />

--<br />

09/29/1952<br />

1 record selected<br />

SELECT TO_CHAR (C1, 'Day, Month ddth'),<br />

TO_CHAR (C2, 'HH12 a.m.') FROM T2;<br />

TO_CHAR (C1,DAY, MONTH DDTH) TO_CHAR (C2,HH12 A.M.)<br />

---------------------------- ----------------------<br />

Monday , September 29th 02 p.m.<br />

1 record selected

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!