conversion from minutes to hours and minutes

Hi all

I want to do two things

1. I want to convert minutes to hours and minutes which is
If there are 350 minutes it should be 5.50

2. I have two times column hrs and time allowed minutes now, I want to join this two in
in this way
for example the hrs is 5 and time allowed mins is 40 so I should be join under 5.40


Concerning
Aerts.

Hello

The code is a little more readable now, but only a little.

For example, I can see now that you call most GRAND where the 1st argument is a string:

    greatest(TO_CHAR ( FLOOR (((timeallowedhrs*60+timeallowedmins)-(timetakenhrs*60+timetakenmins)) / 60)) || ':'

This can cause the error, if the 2nd argument is a NUMBER, but how anyone can find what is the 2nd argument to the LARGEST?
Even though this may not cause the error ORA-01722, there is a good chance that it will give you wrong results. The string "2.00 ' is longer than the string"10 h 45', 2 'being greater than 1'. Perhaps you meant to do more BIG first, then TO_CHAR or maybe you menat another thing altogether.

You can simplify the code you a lot if you did some calculations (such as (timeallowedhrs * 60) + timeallowedmin) only once, in a subquery.
For example:

INSERT INTO  prtempincent (...)
WITH   got_a_t     AS
(
     SELECT DISTINCT
          (timeallowedhrs * 60) + timeallowedmin     AS a
     ,     (timetakenhrs   * 60) + timetakenmin     AS t
     ,     jobcardno
     ,     shop
     ...
)
SELECT     jobcardno
,     '3'
,     ... FLOOR ( (a - t)
                / 60
            ) || ':'
              || TO_CHAR ( MOD ( (a - t)
                                       , 60
                         )
                      , 'FM00'
                      ) ...

I find

a - t

easier to read and understand (and debug), that

(timeallowedhrs*60+timeallowedmins)-(timetakenhrs*60+timetakenmins)

How about you?

Tags: Database

Similar Questions

  • Problem converting from minutes to hours and minutes

    Hello

    I have a problem with this sql, the locations of this sql is to convert minutes to hours and minutes, for example, as you can see, I'm trying to convert 125 minutes in hours and minutes, so the result I get is 2.5 but it should be of 2.05

    If you have an idea how I could get the result to the format: 2.05 which means two hours and 5 minutes?

    It's my sql:
    Select trunc(125/60) || '.' || (125 - TRUNC(125/60)*60) result FROM dual;
    Thanks and greetings
    Carlos
    Select trunc(125/60) || '.' || lpad(mod(125,60),2,'0') result FROM dual;
    
    RESU
    ----
    2.05
    
    SQL> 
    

    SY.

  • Your movie will be ready to watch in 9 hours and 43 minutes.

    I thought that with the advent of the new Apple TV that this problem would be resolved or taken more seriously. Maybe with the rumors that they will create ther own servers for the cloud, it will be, but at the same time other companies continuously seem to be able to exploit this fundamental requirement without problem: I can not watch so often not what I bought when I want to. Last night for example, I went to watch an episode of television and was greeted with a timeout of 9 hours and 43 minutes. Yes, it does improve not only after starting to watch Hulu or Netflix or similar and normally when I'm halfway through watching something else. This problem also extends to the trailers. Sometimes trailers take as long as the trailer to start to play and still in YouTube it will begin instantly. Why? It's infuriating.

    It's particularly frustrating because she is content you own. Is there a solution to this? other than to submit comments is there a way to get this question considered a greater priority? I'm sure this is but lights.

    What version of ATV, which software?

    What is your internet connection speed?

    What the ATV that is connected to the network?

    It's widely reported that iTunes always transmits movies in full 1080 p. Other services, particularly from Netflix, use a lower resolution when they detect a slower flow. For more information, see get help play or content streamed to your Apple TV - Apple Support .

  • Toshiba 46TL938G: mp4 playback stops after 2 hours and 6 minutes

    Hello

    I recently bought a Toshiba 46TL938G.
    The problem I have is that when I am playing a video file mp4 from my USB stick always stops at 2 hours and 6 minutes.

    I tried various usb and different files.
    I suspect that it is a bug in the firmware. I saw here in the forum that another user had the same problem, but it has not been answered. Is this a known issue?

    If it is not who is the right person to contact to?
    I think it is unacceptable to not be able to see a movie when I paid a lot of money to buy this tv!

    It seems that there is already a thread on the same topic:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=70985

    Recommend to follow a thread to avoid misunderstandings.

  • DateTime picker - given to zero hours and minutes on the second click on the datepicker

    Hello

    (APEX 5.0.1 DB 11.2.0.3.0, operating system IBM AIX 7.1, time zone + 1 hour GMT Bratislava)

     

    we have the date picker in the form region with the date format JJ. MM YYYY HH24

    by clicking "Photo calendar" calendar appears with the date and the time displayed

    This means that you can see in "hours selector" currently and in 'selector of minutes', you can see current minutes

    You can change the date, the hour and minute you want

    by clicking on the button "Close" you get the date and time in the date field picker

    So far so good

    However,.

    If you click again on the calendar "Button photo calendar" appears and

    If your current time (I mean normally on a day) is at 09:59

    You will get Zero (0) hours in the hours, selector

    After you present is from 10:00 correct, you will get 10, 11, 12, 13, etc.

    It's for hours and minutes

    If your current time is 10 minutes, for example 08: 07 , 11: 09 , 12: 03 , etc

    On the second click, you'll get Zero (0) minutes

    Similar problem is in the format JJ. MM YYYY HH: mi where you get the 01 in selector hours until 10:00

    Will he please, focus on the fact that it is always on the second, third,... do not click on the first.

    Any ideas please?

    Kind regards.

    Hello

    It was recorded just as a default of 22376688.

    Thank you.

  • Add the hours and minutes so far

    Hello
    I need to write a function that has two input parameters.
    Parameter1 = > Date data type, the value is in GMT.
    Parameter1 = > string value that indicates the time difference and it has the following format.

    GMT (sign) HH24Mi
    for the examples:
    GMT + 400, GMT-1400

    I need to add the offset (param2) to date (param1) and returned as output.

    I wrote a simple code but cannot make it work. I would like to know if there is another way to do it.
    create or replace
    Function         F_FUNCTION_NAME(dt date,timeZoneOffset   in   varchar2)
    return date
    As
        offset  varchar2(9);    
    Begin
        Offset := (To_Char(Substr(Substr(Timezoneoffset,4),0,Length(Substr(Timezoneoffset,4))-2)||':'||Substr(Substr(Timezoneoffset,4),-2)));
        return Dt + interval Offset hour to minute;
    End;
    Thank you.

    Hello

    Delete GMT and use the colon between the hours and minutes in this way:

    ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';
    
    SELECT SYSDATE
         , CAST (CAST (SYSDATE AS TIMESTAMP WITH TIME ZONE) AT TIME ZONE '+4:00' AS DATE) offset_date
      FROM DUAL;
    
    SYSDATE                OFFSET_DATE
    ---------------------- ----------------------
    06-MAR-2013 12:08:01   06-MAR-2013 15:08:01  
    

    Kind regards.
    Al

  • How to convert minutes to hours and minutes?

    Hi Sir,

    I want to convert minutes is 90 you want to convert hours and minutes this format should be

    01:30 format.

    I can't in this format?

    Thank you

    Or like this...

    SQL> select to_char(trunc(sysdate)+90/(24*60),'HH24:MI') from dual;
    
    TO_CH
    -----
    01:30
    
  • Convert seconds to hours and minutes

    Hello

    I have a column that stores the elapsed time in seconds. I would like to convert to hours and minutes.

    FOR EXAMPLE

    126 seconds = 2:06. I can't find anything with a search.

    Thanks in advance.

    Hello
    Try this code.
    Salim cordially.

    SELECT TO_CHAR (TRUNC (SYSDATE) + NUMTODSINTERVAL (126, 'second'),
                    'hh24:mi:ss'
                   ) hr
      FROM DUAL;
    
    HR
    --------
    00:02:06
    
    1 row selected.
    
  • I tried to reinstall yosemite OX since yesterday after I wipe the drive and it froze.  It is said bark 2 hours and 7 minutes since last night.  What can I do?

    I tried to reinstall yosemite OX since yesterday after I wipe the drive and it froze.  It is said about '2 hours and 7 minutes' since last night.  What can I do?

    Try to turn off the computer with the power switch, and then restart.

  • Wizard Boot Camp is stuck at "Download windows software support...". "0 minutes 0 seconds remaining (for 48 hours and more) ' for Windows 10 Pro

    Wizard Boot Camp is stuck at "Download windows software support...". "0 minutes 0 seconds remaining (for 48 hours and more) ' for Windows 10 Pro.

    I did Boot Camp with 8,1 this system successfully but the upgrade of Windows 10 dorked BootCamp upward when it is added to the system partition.  Has had a lot of work, but ultimately got all partitions disappeared and I tried Boot Camp and got it.  I erased the disc and then reinstalled El Capitan sweet factory without bringing more parameters.  Now, I still get the same error?

    I tried a few sizes of ~ 50 to 170 G with no luck.  It's on a MBP 2016 15 "with retina, 512G SSD, 16G RAM, GPU display.

    Any suggestions?  Troubleshooting?  I can't yet find/say if this thing creates something useful for a log file or?

    1. you download Windows Support software on a wireless connection? If so, try a connection cable, if possible.

    2. Please look in Applications-> utilities-> Console logs for error messages.

  • Adding the hours and minutes

    I want to add a long list of hours and minutes in numbers.

    The list will come to 1000 + hours and I want that it displays the actual number of hours and minutes, not expressed in days.

    Impossible to find a way to format the cells to allow me to th

    Did you try & see if a few suggestions here may work?

    • Create a custom cell format - Numbers Help for Mac:

    http://help.Apple.com/numbers/Mac/3.2/#/tan090042718

    The database can provide also other useful elements, if ticked off more.

    Good luck & happy computing!

  • Server 2012 jumps before 7 hours and 2 minutes or 2 to 4 new minutes during a reboot

    Whenever I reboot server running 2012 on my domain it is past directly on reboot for 2 to 4 minutes or 7 hours and 2 minutes and that the NTP server corrects for the final stages at the start. I looked on the Microsoft, HP and Dell websites with no luck. Any help would be appreciated.

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • convert a number in days, hours and minutes

    Hello

    I have a table that store minutes unpaid.

    I want to get the days, hours and minutes in separate columns

    After working hours, a day is considered to be 8 hours

    That is to say. 480 minutes is considered to be one day.

    create the table unpaidmins as

    (

    Select 480 as unpaidmins of all the double union

    Select 420 as unpaidmins of all the double union

    Select 75 as unpaidmins of all the double union

    Select 55 as double unpaidmins

    )


    Required result

    --------------------------------------------------------------------

    DAY HOURS MINUTES

    ---------------------------------------------------------------------

    1                         0                          0


    0                         7                         0


    0                         1                          15


    0                         0                           55


    -------------------------------------------------------------------



    I use oracle 10g


    Help, please






    Select

    trunc(unpaidmins/60/8) as 'DAY '.

    , trunc (mod (unpaidmins, 60 * 8) / 60) "the hours."

    , mod (mod (unpaidmins, 60 * 8), 60) as "MINUTES".

    of unpaidmins

    DAY HOURS MINUTES

    "1"    "0"    "0"

    "0"    "7"    "0"

    "0" "1" "15".

    "0" "0" "55".

  • show only the hours and the minutes of a timestamp

    Hi, I have a timestamp column in OBIEE, but I just need to view the hours and the minutes and ignore everything else.

    Is there a way to do this?

    Thank you

    use hh: mm

  • I can't open a pdf from last week. I have a Samsung s6 edge with t-mobile. I spent an hour and a half with t-mobile tech support and they told me to email you because they don't know what else to do. [Android]

    I can't open a pdf from last week. I have a Samsung s6 edge with t-mobile. I spent an hour and a half with t-mobile tech support and they told me to email you because they don't know what else to do.

    Hi Edwin,.

    May I know what is happening when you try to open a PDF file with Adobe Acrobat app on your device Galaxy.

    Try this:

    Go to settings > Applications > Adobe Acrobat

    Under the terms of the App Info, click on clear Cache

    Then try to open a PDF file

    Still, if this does not work

    Uninstall the application

    Then download and install directly from APK files.

    Adobe - Adobe Acrobat Reader DC Distribution

    I would like to know if it works for you.

    Thank you

    Abhishek

Maybe you are looking for

  • with 2 windows open, if I zoomed in Windows Active, expanded as this one. How to avoid this?

    Conditions:2 windows of firefox open 21.0, showing 2 different pages, which comes from the same server.One of the 2 pages it active, having shot on it with the mouse.If I try to zoom on active windows, is enlarged also another one that is not active.

  • Hey, I was wondering if it might well work on my laptop [GTA IV]

    Hey guys, I've just bought a new laptop (acer 5738Z), And I was told that my video card is not that good to run this game, but I want to hear what you guys have to say. my laptop: CPU - Pentium Dual-Core T4300 2.10 GHz CPU RAM - 1, 9 GB OS - Microsof

  • Windows Live Messenger has lost connection

    I have an ongoing problem with Windows Live Messenger 2011 constantly losing connection on me. Without warning, he will lose connection. I don't get an error message, it just trying to reconnect on its own.

  • VCAP-DCD transferred, now on the DCA

    Hi guysSo I spent my DCD Tuesday (18th), and I must admit that it was not easy, which is currently a VCAP is worth much more.Also, now on my DCA (I should have probably done their vice versa?), but have the following preparation in mind:I should prob

  • How to change the Spry CSS tab

    I like to use these old screens provided with the former DW Spry tab.  I just looked in DW CC and it looks like they aren't there and more.  But anyway, I made one for my client.  Now, they want to get one of the tabs on the far right of the margin.