Convert minutes to hh

Hello people,

I date of type VARCHAR with format hh: mm: however HH can be more than 24 for example 98:59:23.

I need help converting this fileld (LAG) minutes.

Thanks in advance for your help.


CREATE

TABLE LOAD_INFO_ALL



(

TMSTP 

DATE

,


PROGRAM VARCHAR2(20 CHAR

),


STATUS 

VARCHAR2(20 CHAR

),


GRP 

VARCHAR2(20 CHAR

),


LAG 

VARCHAR2(20 CHAR

),


CHKPT 

VARCHAR2(20 CHAR

)

Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 07:03:23', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:53:31', 
    '00:06:37');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 07:11:01', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:53:31', 
    '00:14:39');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 07:26:31', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:53:31', 
    '00:29:55');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 07:18:38', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:53:31', 
    '00:22:14');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 07:34:23', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:53:31', 
    '00:37:49');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 05:49:17', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:30:57', 
    '00:14:06');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 05:57:53', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:30:57', 
    '00:22:43');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 05:40:40', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:30:57', 
    '00:05:29');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 06:47:40', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:10:15', 
    '00:34:31');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 06:32:05', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:10:15', 
    '00:19:04');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 06:16:51', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:10:15', 
    '00:03:39');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 06:55:20', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:10:15', 
    '00:42:17');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 06:39:53', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:10:15', 
    '00:26:37');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 06:24:29', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:10:15', 
    '00:11:23');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 05:32:03', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:00:24', 
    '00:27:23');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 05:23:21', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:00:24', 
    '00:18:44');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 05:14:41', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:00:24', 
    '00:10:05');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 05:06:02', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '99:00:24', 
    '00:01:22');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 04:48:42', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '98:30:24', 
    '00:14:10');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 04:40:04', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '98:30:24', 
    '00:05:30');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('02/08/2013 04:57:20', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '98:30:24', 
    '00:22:47');
Insert into LOAD_INFO_ALL
   (TMSTP, PROGRAM, STATUS, GRP, LAG, 
    CHKPT)
 Values
   (TO_DATE('06/03/2013 06:09:05', 'MM/DD/YYYY HH24:MI:SS'), 'REPLICAT', 'RUNNING', 'RBGRA06A', '98:26:43', 
    '00:39:33');
COMMIT;

Select round (REGEXP_SUBSTR ('98:59:23', ' [^:] +', 1, 1) * 60 +)

REGEXP_SUBSTR ('98:59:23', ' [^:] +', 1, 2) +.

REGEXP_SUBSTR ('98:59:23', ' [^:] +' 1, 3) / 60,

2)

of the double

5939.38

----

Ramin Hashimzade

Tags: Database

Similar Questions

  • 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 minutes of difference in timestamps

    Hello, using Oracle 11 g R2.

    Looking for a way to convert the differnce in systimestamps the number of minutes.

    Select systimestamp - order_received_ts

    of order_table

    where order_id = 17978

    Something like that?

    Select

    extract (day of ts) * 24 * 60

    + extract (ts time) * 60

    + extract (minute of ts)

    minutes

    de)

    Select systimestamp - ts order_received_ts

    of order_table

    where order_id = 17978

    )

    If you want only the seconds to showed too just add

    + extract ((deuxieme from ts)

  • Convert Minutes to days, hours, minutes format

    Hello

    Can someone help me out to convert the Minutes in days, hours, minutes of OBIEE.

    Ex: 3185 = 2 days, 5 hours, 5 minutes.

    Thanks in advance


    -Shema

    There is a post here Associates: http://kpipartners.blogspot.com/

    J
    -bifacts
    http://www.obinotes.com

  • minutes convertting

    Hi experts,

    can you tel me how to convert minutes under request
    SELECT RunId,
    run_owner,
    RUN_DATE,
    run_total_time,
    run_comment
    OF PLSQL_PROFILER_RUNS
    WHERE
    run_comment = 'VIP ';

    run_total_time data type is number converted into minutes

    This?

    run_total_time /( 1000000000 * 60 ) in_minutes
    
  • 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.

  • 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?

  • How to convert the number and time of storage in my table

    Hai all

    I have a table called present in that certain fields are

    Code varchar

    Name varchar

    Date of the respondent

    outtime date

    eTime number

    number of wtime

    number of cutmin


    SO I Wtime calculated by Outtime sub - intimate and now I need to calculate the time additional IE Etime

    So for all employees working hours are 0830 so I need for less 0830 train employees working hours

    How can I convert this at 0830 and sub with Wtime and to get the exact time


    Thanks in advance

    srikkanth. M

    Hello!

    Outtime - intimate is a figure which means days

    0830 8.5 hours and that's 1/24 * 8.5 days.

    Lets say I work today between 0700 and 1510

    Follow my example

    SQL> with data as (
      2    select to_date('02.04.2010 15:10','DD.MM.YYYY HH24:MI') outdate ,
      3           to_date('02.04.2010 07:00','DD.MM.YYYY HH24:MI') indate ,
      4           1/24 * 8.5 need_to_work from dual )
      5  select round((outdate - indate - need_to_work) * 1444) etime_in_minutes from data
      6  /
    
    ETIME_IN_MINUTES
    ----------------
                 -20
    
    SQL> 
    

    Again you can now convert minutes to hours or test whether etime is negative or what...

    Then in your case update statement would be

    update attendance set etime = round((outtime - intime - 1/24*8.5) * 1444) where 
    

    T

    Published by: ttt on 1.4.2010 22:17

  • calculate the number of minutes

    Hello citizens of oracle,

    I have a situation where I have to calculate the number of minutes took to run the package. I've seen proc_log that will give me proc_name (give me the name of the proc), START_DT (which gives the time when the process began exactly) and EXEC_TIME (gives having plenty of time each process taken in minutes and seconds). So I need to make the sum of the column EXEC_TIME. Please help me how to do this.

    Thanks for the help.

    Sam

    So, how do you intend to group on a varchar2 column? Can you change the view to the EXEC_TIME in an interval instead? Is even more logical design-wise.

    Please post some examples of data so I can get an idea of the format for the varchar2 column.  Want to most likely to convert it to an interval to summarize time exec, or converting varchar2 int to exec_time in a few seconds, then convert minutes to maintain granularity.

    NM, I see here the format, you are def going to need to set this view if you want to match the runtime.

    You are with your format makes it incredibly hard perform such an easy task. Change this EXEC_TIME column in the view to an int of total of seconds or milliseconds of delay of performance or do this column, an INTERVAL DAY TO SECOND data type. Once you do this, you can do a 'SELECT sum (exec_time) FROM WHERE XX... »

    Published by: TheDudeNJ on November 12, 2009 13:48

    Published by: TheDudeNJ on November 12, 2009 13:49

    Published by: TheDudeNJ on November 12, 2009 13:51

  • Ticker display the time spent on a page

    I want to show the user the time elapsed since their entry to the page in a ticker that updates every second. So I would say...


    00:00

    00:01

    00:02

    00:03

    ...


    I look at some different methods to do it, but I'm not an expert in Javascript and I am very new to animate dashboard. While I try to figure it out, I wanted to see if I could get feedback on the good way (s) to do so.


    I've been playing with creating a symbol that has a 1 second loop the timeline, and having an action triggered in this timeline. But that requires you to get time at the beginning and then access and manipulate, and who gets easily spoil/do evil.


    Or you can create a loop that increments every second, probably using setInterval() , and just ++ a counter variable. But I don't know if that would be executed asynchronously of everything.

    So if anyone has treaded similar waters, I would be very happy comments!

    Thank you very much!

    Here's an improved version.

    I wanted to see a 0 in the 10s place if the meter has been less than 10. Then I wanted to 00:00:00, not 0:0:0.

    And before I had done all of the globally accessible variables, which is not necessary. The only one that must be accessible in the world (in my case) is timerCombined, which you can access at:

    sym.getComposition () .getStage () .getVariable ('timerCombined');

    sym.getComposition () .getStage () .setVariable ('timerCombined', 'value');

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

    Create variables

    //"... Variables in the format' should say '00:00:00 ' instead of ' 0:0:0 ".

    var secondCounter = 0;

    var secondCounterFormatted = '00';

    var minuteCounter = 0;

    var minuteCounterFormatted = '00';

    var hour meter = 0;

    var hourCounterFormatted = '00';

    Combining everything into one

    sym.setVariable ('timerCombined', ' 00:00:00 ');

    {setInterval (function ()}

    Number of seconds

    secondCounter ++;

    If (secondCounter< 10)="">

    secondCounterFormatted = "0" + secondCounter;

    } else {}

    secondCounterFormatted = secondCounter

    }

    Convert seconds to minutes

    if(secondCounter == 60) {}

    secondCounter = 0;

    minuteCounter ++;

    If (minuteCounter< 10)="">

    minuteCounterFormatted = "0" + minuteCounter;

    } else {}

    minuteCounterFormatted = minuteCounter

    }

    }

    Convert minutes to hours

    if(minuteCounter == 60) {}

    minuteCounter = 0;

    hours counter ++;

    If (hour meter< 10)="">

    hourCounterFormatted = '0' + hour meter;

    } else {}

    hourCounterFormatted = hour meter;

    }

    }

    sym.getComposition () .getStage () .setVariable ('timerCombined', (hourCounterFormatted + ':' + minuteCounterFormatted + ':' + secondCounterFormatted));

    (}, 1000);

    ^ Here set the time in milliseconds

  • minute to convert hours

    Hello

    How convert 150 minutes (int) 02:30 (string) time minute.if any other method without this program.

    Bob_Schor wrote:

    I prefer channel Scan (as I can do it "both")

    I think you mean in this case of Format string.

  • How to convert the Minutes (digital format) to hh: mm in SQL

    I have a column of data (Duration_Min_Amount) that displays the number of minutes used. I need to convert it to the format hh: mm and can't seem to figure out how.

    I need the data to show 930 = 15:30.

    Someone knows how to do this? I searched google and tried using CAST but cannot get the syntax works.

    ((A.DURATION_MIN_AM) / 60) |': ' | TO_CHAR (mod (SUM (A.DURATION_MIN_AM), 60), 'FM00') AS DURATION_MIN_AM,

    First display, sum the latter.

    or

    RTrim)

    LTrim)

    RTrim)

    NUMTODSINTERVAL (SUM (A.DURATION_MIN_AM), "OTHER")

    ,'+0: ')

    ,'+0: ')

    ,'.') AS DURATION_MIN_AM_I,

  • I bought the ability to convert PDF files into word documents. However, when I opened a PDF it does not include the right panel that had been giving me the option to convert. After spending 30 minutes on a cat, I learned that (1) the option is not on the

    I bought the ability to convert PDF files into word documents. However, when I opened a PDF it does not include the right panel that had been giving me the option to convert. After spending 30 minutes on a cat, I've learned that (1) the option is not on the right side panel on Acrobat 9 Pro, (2) it is on the top. What should I do to convert my files?

    Look at the file menu.

  • Take a minute to tell us about converter!

    Dear VMware

    We collect your comments regarding your use of VMware Converter. This feedback is helping us make Converter a better product!

    It will take you only a minute to participate - all you have to do is answer on this short survery:

    http://www.surveymethods.com/enduser.aspx?7F5B372E7D3B2E287F

    Thank you

    Antoan Arnaudov

    (Product Manager, VMware)

    Just tweeted in order to raise the number of responses

  • convert 3 minutes of each file.

    We need to encode the QT to H264 files, but we only need exactly 3 minutes at the beginning of each file.  Is it possible to configure the SOUL to automatically convert 3 minutes of each file? without having to enter each clip and set in and out points?

    Hi Dori,

    We need to encode the QT to H264 files, but we only need exactly 3 minutes at the beginning of each file.  Is it possible to configure the SOUL to automatically convert 3 minutes of each file? without having to enter each clip and set in and out points?

    Sorry, no. I would like to import to Premiere Pro, set on edge and export from there.

    Thank you

    Kevin

Maybe you are looking for