Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Venkat.

Asked: October 24, 2016 - 4:28 pm UTC

Last updated: October 25, 2016 - 1:09 am UTC

Version: 12.xx

Viewed 1000+ times

You Asked

Hello-

I have a field which totals the number of hours worked; and for example returns a figure of 41.75

What is the best way to represent this number as 42 hours and 15 minutes?

Thanks
Venkat

and Connor said...

Um.... so you want to get an extra hour for free ? :-)

I'll assume you want 41 hours and 45 mins.

SQL> with raw_data as
  2   ( select 41.75 x from dual )
  3  select
  4    trunc(x) hrs,
  5    mod(x,1)*60 mins
  6  from raw_data;

       HRS       MINS
---------- ----------
        41         45


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thank you!!

A reader, October 25, 2016 - 12:50 pm UTC

I can use the extra hour!!!

Thank you, that helped!!