Skip to Main Content

Breadcrumb

XMAS_TREE

The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.

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)

We're not taking comments currently, so please try again later if you want to add a comment.

Comments

Thank you!!

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

I can use the extra hour!!!

Thank you, that helped!!