Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

varchar2 format to AM/PM

Status
Not open for further replies.

mars19301

MIS
May 31, 2001
69
US
The course starting time is in a 24 hour field (varch2(4))that I must display as AM or PM as appropriate. Would somebody point me in the right direction? Thank you in advance for your help.
 
Mars,

Here is the technique:
Code:
select to_char(to_date('2215','hh24mi'),'hh:mi A.M.') from dual;

TO_CHAR(TO
----------
10:15 P.M.
Of course, instead of the literal that I used ('2215'), you would refer to the name of the VARCHAR2(4) column.

Let us know if this resolves your question.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top