Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert a decimal to time value...

NapsterNov 7 2013 — edited Nov 8 2013

Hi Guys,

I have to convert a time value represented by decimal to a hh:ss format. I have come up with the following... Is there an easy (elegant) way to do this?

select SUBSTR(TO_CHAR(time),0, (INSTR(TO_CHAR(time),'.')-1)) || ':' ||

TO_CHAR((TO_NUMBER(SUBSTR(TO_CHAR(time), (INSTR(TO_CHAR(time),'.')+1), LENGTH(time)))/100)*60)

from (select '6533.50' time from dual);

Thanks,

Napster

This post has been answered by Ramin Hashimzadeh on Nov 7 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2013
Added on Nov 7 2013
15 comments
4,388 views