iMessage Timestamp - hours: Minutes: seconds

Anyone know if its possible to get the second exactly an iMessage was sent / received?

is not possible. not very useful, and therefore will not be implemented either.

Tags: iPhone

Similar Questions

  • Show the average time in days hours minutes seconds

    Hello

    I have two tables as follows,

    Is it possible to separate the average time in days, hours, minutes, seconds.

    I need the average time required for each account.

    with
    Table1 as
    (select "AAA" acname, 123 tid, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') ltime Union double all the )
    Select 'AAA', 456, to_date (January 11, 15 15:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 'BBB', 789, to_date (11 January 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 'CCC', 990, to_date (11 January 15 18:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 'BBB', 880, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 'DDD', 770, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 'BBB', 555, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double
    ),
    Table2 as
    (select txid 123, to_date (January 11, 15 14:00 ',' dd-mm-aa hh24:mi:ss') mtime of union double all the )
    Select 456, to_date (January 11, 15 16:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 789, to_date (11 February 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 770, to_date (11 February 15 07:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 990, to_date (11 January 15 23:30 ',' mm-dd-aa hh24:mi:ss') of all the double union
    Select 880, to_date (11 February 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 555, to_date (11 February 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double
    )
    Choose acname, avg (hrs)
    from (select distinct t1.acname, (t2.mtime - t1.ltime) * 24 h )
    from table1 t1,
    Table2 t2
    where t1.tid = t2.txid
    )
    Group acname


    Expected results


    ACNAME Avg (day) APR (hrs) Avg (Mins) Avg (dry)

    AAA 0 1 0 0 (that is to say 14:00-13:00 = 1 and 16 15 = 1, Avg = (1 + 1) / 2 = 1)

    BBB          1               0          0               0

    CCC          0               5          30             0

    DDD          1               2          0               0

    with

    Table1 as

    (select 'AAA' acname, 123 tid, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') ltime Union double all the)

    Select 'AAA', 456, to_date (January 11, 15 15:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 'BBB', 789, to_date (11 January 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select "CCC", 990, to_date (11 January 15 18:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 'BBB', 880, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 'DDD', 770, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 'BBB', 555, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double

    ),

    Table2 as

    (select txid 123, to_date (January 11, 15 14:00 ',' dd-mm-aa hh24:mi:ss') mtime of union double all the)

    Select 456, to_date (January 11, 15 16:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 789, to_date (11 February 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 770, to_date (11 February 15 07:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 990, to_date (11 January 15 23:30 ',' mm-dd-aa hh24:mi:ss') of all the double union

    Select 880, to_date (11 February 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 555, to_date (11 February 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double

    )

    Select acname,

    trunc (AVG (Days)) days,

    trunc (mod (AVG (Days), 1) * 24) hours,

    trunc (mod (AVG (Days) * 24.1) * 60) minutes.

    trunc (mod (AVG (Days) * 24 * 60.1) * 60) seconds

    from (select distinct t1.acname,(t2.mtime-t1.ltime) days

    FROM table1 t1,

    table2 T2

    where t1.tid = t2.txid

    )

    Acname group

    /

    ACN DAYS HOURS MINUTES SECONDS

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

    BBB         31          0          0          0

    CCC          0          5         30          0

    AAA          0          1          0          0

    DDD         31          1          0          0

    SQL >

    SY.

  • Countdown days, hours, minutes, seconds script

    Sure could use some help here.

    "RAT77" wrote in message news:[email protected]...
    > tralfaz
    > It was the only post I made the request. I would like to have the
    > actionscript that will be the countdown of the current date in days/hours/minutes/seconds to a
    > later date then displays a short message. I tried to use more
    > actionscript and all help to spoon feed me would be greatly appreciated.

    Oh, ok. I thought you were complaining that no one has been to help you with your previous question. It is useful to ask a
    issue.

    See if one of these messages can help you...
    http://tinyurl.com/l4wc4

  • I need to get date-date by number of days, hours, minutes, seconds.

    I have two dates, A and b... .i need to get the B - number of days, hours, minutes, seconds.

    I need differnce between two dates in days, hours, minutes, seconds.

    the day was 8 hours. Sat/Sun off

    It's simple if we consider our regular calendar... .but how can I get the same if a work_calander...

    That is, for example, A = Fri evening 17:00
    B = Monday evening 17:00

    the result should be 8 hours... (Sat/Sun, judge 9-6 to the timetables of office.. .so 1 pm Friday and 7: 00 in the LUN)

    such a schedule is defined.

    Please give a solution

    Thanks in advance
    Prince

    Published by: Prince on August 27, 2008 23:42

    your query is not clear enough.

  • How can I make the hour, Minute, second information in the RMAN log?

    DB version: 11.2.0.3

    Platform: Oracle Enterprise Linux 6.2

    An excerpt from log RMAN backup file.

    As indicated by the arrows below, the RMAN backup log only information hour, Minute, and second. It was just the date 14 October 13

    archived journal entry thread = 1 sequence = RECID 10946 = STAMP 21079 = 828801629

    archived journal thread = 2 sequence = 10137 entry RECID = STAMP 21081 = 828801794

    archived journal thread = 1 sequence = 10947 entry RECID = STAMP 21080 = 828801731

    CH01 channel: from song 1 to 14 October 13-> we need some time here as 17:28:43

    channel ch00: finished piece 1 to 14 October 13

    piece handle = al_9306_1_828819222 tag = comment TAG20131014T190816 = Version of the API 2.0, MMS Version 5.0.0.0

    channel ch00: complete set of backups, time: 00:14:55

    channel ch00: archived deletion or newspapers

    .

    .

    < snipped >

    How can I set up the equivalent of below declaration for registration of RMAN?

    ALTER session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS ";

    Hello

    We recommend that you always set you variable NLS_DATE_FORMAT so tah you see the hou, minute and second components of the date when the RMAN command. IF you be wrapped a gall newspaper during backup, restore and recovery controls, then this will ensure that a component of timestamp is disapled. This cabin can be useful when you are trying to solve the problems of RMAN.

    If you do not set NLS_DATE_FORMAT, then you will not see the hour, minute, and the second component of the date columns. Excerpt from the output of a list without set NLS_DATE_FORMAT command:

    Time of accomplishment of TIME TYPE LV SIZE DEVICE TYPE ELAPSET BS keys

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

    201 full DISCK 18.66 M 03:00:00 January 1, 13

    Here is the result even when the NLS_DATE_FORMAT is set. Notice how the hours, the minutes and the seconds are now displayed:

    Time of accomplishment of TIME TYPE LV SIZE DEVICE TYPE ELAPSET BS keys

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

    201 full DISCK 18.66 M 03:00:00 January 1, 13 12:11:25

    You can check the value of NLS_DATE_FORMAT of your operating system with the echo command environment. ON UNIX, use echo as follows:

    $echo $NLS_DATE_FORMAT

    Here is an example of Windows to display NLS_DATE_FORMAT using the echo command:

    c:\>echo % NLS_DATE_FORMAT %

    To disable an OS variable, simply make it void. For example, to unset NLS_DATE_FORMAT in an environment of the UNIX C shell, use the OS unsetenv command:

    $unsetenv NLS_DATE_FORMAT

    IN an environment of the UNIX KORN shell, use export OS as follows:

    $export = NLS_ADTE_FORMAT

  • The cursor does not show hour minute second

    Hello.

    I have the following

    PROCEDURE SP_GETHISTORICPAYMENT)

    IO_CURSOR ON T_CURSOR,

    O_CODTRANS OUT VARCHAR2,

    IS

    Tester varchar2 (2000);

    BEGIN

    Open the IO_CURSOR for

    Select tlt_date in the BF_MTP_TRA_LOGTRANSACTIONAL where rownum < 2;

    Select tlt_date in the BF_MTP_TRA_LOGTRANSACTIONAL Tester where rownum < 2;

    O_CODTRANS: = Tester;

    "The value of tlt_date is 13 May 15 15:27:32.

    The result of the execution of the stored procedure is:

    IO_CURSOR = 13 MAY 15 00:00:00 '

    O_CODTRANS = 13 May 15 15:27:32 '


    Why the cursor is not displayed the minute and the second time?


    I tried with

    Open the IO_CURSOR for

    Select TO_DATE (tlt_date, ' dd/mm/YY hh24:mi:ss') of BF_MTP_TRA_LOGTRANSACTIONAL where rownum < 2;

    But it does not work.

    How can I do to get the hour minute and second of a cursor in a procedure.

    Thank you.


    Do you like reading and thinking about the answers? Last attempt:

    PROCEDURE SP_GETHISTORICPAYMENT)

    IO_CURSOR ON T_CURSOR)

    IS

    BEGIN

    Open the IO_CURSOR for

    Select TO_CHAR (tlt_date, ' dd/mm/YY hh24:mi:ss') of BF_MTP_TRA_LOGTRANSACTIONAL where rownum< 2="">

    END SP_GETHISTORICPAYMENT;

    SY.

  • timer counts down to the format hours: minutes: seconds: milliseconds

    Nice day

    Has had a problem with this kind of format treatment.

    And I want the milliseconds in 2 digits only.

    Any help is greatly appreciated.

    Here is my code:

    intervalID = setInterval(this,"timerFunction",1);

    function timerFunction() {}

    var msec:Number = getTimer();

    if (msec < = 0) {}

    play();

    return;

    }

    var sec: Number = Math.floor(msec / 1000);

    var min:Number = Math.floor(sec / 60);

    var time: Number = Math.floor(min / 60);

    if(sec<10) {}

    secStr = "0" + String (dry);

    } else {}

    s = secStr;

    }

    if(min<10) {}

    minStr = "0" + String (min);

    } else {}

    MINSTR = min;

    }

    if(hour<10) {}

    hourStr = "0" + String (hour);

    } else {}

    hourStr = time;

    }

    //trace ("min:" + min);

    //trace ("sec:"+ dry ");

    //trace ("ms:"+ msec ");

    _root.timerText = hourStr + ': ' + MINSTR + ":" + secStr + ":" + msec;

    }

    Display the result:

    00:00:01:1012

    00:00:02:2048

    You will not contravene all rules (don't know too many except those to be polite, etc.), but you neglected to say what to look for.  I finally found what I think you're talking about and what is displayed it is meaningless.  I think it's just a Visual prop because it seems never to go beyond 20 - something.  And that the way in which the time end up like the exact values, it is certainly rigged.

    As I said already 1000 msec = 1 sec, and you can get up to 99 with two digits, then you should think about what you want to do.

  • How to set the clock for the hours, minutes, and seconds with Windows XP

    How to set the clock for the hours, minutes, and seconds with Windows XP

    I don't know of your question.  If you ask how to show the clock in the tray system with hours, minutes and seconds, then download & run "Tclock Light".  Windows will not natively display the seconds.

    TClock Light: <> http://homepage1.nifty.com/kazubon/tclocklight/index.html >

    HTH,
    JW

  • A design of query for the conversion of time difference in days, hours, Minutes

    Hi all

    A design of query for the conversion of time difference of time in number of days remaining remaining hours minutes and rest in seconds. Made this one till now. Please suggest for all modifications, until now, it seems to work very well, kindly highlight for any anomaly.

    WITH DATA (startDAte, EndDate, Datediff) AS (SELECT to_date ('2015-10-01 10:00:59 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-20-01 03:00:49 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-10-01 10:00','yyyy-dd-mm hh24:mi:ss')-to_date('2015-20-01 03:00','yyyy-dd-mm hh24:mi:ss') FROM dual)

    UNION ALL SELECT to_date ('2015-10-01 10:00:39 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-20-01 03:00:40 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-10-01 10:00','yyyy-dd-mm hh24:mi:ss')-to_date('2015-20-01 03:00','yyyy-dd-mm hh24:mi:ss') FROM dual

    UNION ALL SELECT to_date ('2015-11-01 10:30:45 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-11-01 11:00:50 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-11-01 10:30','yyyy-dd-mm hh24:mi:ss')-to_date ('2015-11-01 11:00 ',' yyyy-mm-dd hh24:mi:ss') FROM dual

    UNION ALL SELECT to_date ('2015-11-01 09:00:50 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-11-01 10:00:59 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-11-01 09:00','yyyy-dd-mm hh24:mi:ss')-to_date ('2015-11-01 10:00 ',' yyyy-mm-dd hh24:mi:ss') FROM dual

    UNION ALL SELECT to_date ('2015-11-01 08:30:49 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-11-01 09:30:59 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-11-01 08:30','yyyy-dd-mm hh24:mi:ss')-to_date('2015-11-01 09:30','yyyy-dd-mm hh24:mi:ss') FROM dual

    )

    Select

    trunc ((EndDate-StartDate)) days.

    trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24) hours)

    trunc (to_number (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24-trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24)) * 60) Minutes,))

    (to_number (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24-trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24)) * 60 - trunc (to_number (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24-trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24)) * 60)) * 60 seconds))))

    data;

    Thanks for the answers in advance.

    AHA!

    TO_TIMESTAMP expects a string as input, so it first makes an implicit conversion from DATE to a string, in the format of NSL_DATE_FORMAT.

    To convert the TIMESTAMP DATE independently NLS_DATE_FORMAT, use

    CAST ( AS TIMESTAMP)

  • How to get the timestamp per minute for the given interval

    Hello

    I have a table with a date of beginning and end of time columns. I need to divide the date given in one minute interval and post the results.

    create table min_data(objectid varchar2(20),starttime timestamp,endtime timestamp,duration number);
    
    
    SET DEFINE OFF;
    Insert into MIN_DATA Values ('U1_B011_P006_InvA', TO_DATE('06/23/2015 02:42:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/23/2015 02:46:00', 'MM/DD/YYYY HH24:MI:SS'), 5);
    Insert into MIN_DATA Values ('U1_B011_P006_InvA', TO_DATE('06/23/2015 12:43:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/23/2015 12:44:00', 'MM/DD/YYYY HH24:MI:SS'), 2);
    COMMIT;
    
    
    
    
    

    My expected output should be something like this. INT_TIMESTAMP is the timestamp calculated for the given interval (time of start and end times)

    INT_TIMESTAMPOBJECTIDSTARTTIMEEND TIME
    23/06/2015-02:42U1_B011_P006_InvA23/06/2015-02:4223/06/2015-02:46
    23/06/2015-02:43U1_B011_P006_InvA23/06/2015-02:4223/06/2015-02:46
    23/06/2015-02:44U1_B011_P006_InvA23/06/2015-02:4223/06/2015-02:46
    23/06/2015-02:45U1_B011_P006_InvA23/06/2015-02:4223/06/2015-02:46
    23/06/2015-02:46U1_B011_P006_InvA23/06/2015-02:4223/06/2015-02:46
    23/06/2015 12:43U1_B011_P006_InvA23/06/2015 12:4323/06/2015 12:44
    23/06/2015 12:44U1_B011_P006_InvA23/06/2015 12:4323/06/2015 12:44

    I wrote a query that works for one set of intervals.

    With get_data AS(
    SELECT   a.*,
             starttime -1/1440 v_s_date,
             endtime v_e_date
    FROM min_data a
    where duration=5)
    SELECT v_s_date + ((1 / 1440) * DECODE(LEVEL, 1, 1, LEVEL)) int_timestamp, objectid,starttime,endtime
              FROM get_data d
             WHERE MOD(LEVEL, 1) = 0
                OR LEVEL = 1
            CONNECT BY LEVEL <= (v_e_date - v_s_date) * 1440;
    
    

    Please send me a SQL query that gives me the timestamps of minutes between intervals.

    Hello

    The following query works for any number of intervals

    SELECT STARTTIME + ((LVL-1) / 1440) INT_TIMESTAMP, OBJECTID, STARTTIME, ENDTIME

    Of

    (SELECT LEVEL LVL FROM DUAL CONNECT BY LEVEL< 10)="">

    (SELECT * FROM MIN_DATA)

    WHERE STARTTIME + ((LVL-1) / 1440) BETWEEN STARTTIME AND ENDTIME ORDER BY, STARTTIME, ENDTIME LVL;

    Concerning

    Salim

  • How to add hours, Minutes in table

    How to add hours, Minutes to the table, I get an error time between 1 and 12 below is my code

    PACTUALOUTTME: = TO_DATE (' 17:00 "," HH: MI PM ');
    PROUNDEDINTIME: = TO_DATE (' 09:05 ',' HH: MI AM');
    PROUNDEDOUTTIME: = TO_DATE (' 16:12 ',' HH: MI PM ');
    PHRSWORKED: = TO_DATE('08:05','HH:MI');
    * PLATE: = TO_DATE('00:12','HH:MI'); **
    * PLEFTEARLY: = TO_DATE('00:05','HH:MI'); **
    POT: = TO_DATE('01:00','HH:MI');
    PCOMMENTS: = "left early."
    PREMARKS: = 'Permission ';
    PCREATEDBY: = '101';

    I want to insert hours with the minutes and the minutes, I used the DATE data type for date and time columns preceding

    I think that the highlight is making the error any help please

    Use HH24 during the day between 0 and 24 hours.
    Use HH for hour of day between 1 and 12.

    PLATE: = TO_DATE('00:12','HH24:MI');
    PLEFTEARLY: = TO_DATE('00:05','HH24:MI');

    Good luck

    Published by: user9251649 on 26.09.2012 00:25

  • 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

  • A group of consecutive dates to get some absences (days, hours, minutes) and incidents

    Hello

    I'm trying to calculate and history of lack of list based on the details of lack follows.

    Here is what I got: (sorry for the dotted lines between the two, I put it just to format the data)

    EMP_ID - WORK_DT - PM - REASON - PAID
    =====-----=======------===-=====-- -- ====
    123---06/01/2009---8.0---malades---PAYE
    123---07/01/2009---8.0---malades---PAYE
    123---08/01/2009---8.0---malades---PAYE
    123---09/01/2009---8.0---malades---PAYE
    123---16/01/2009---8.0---FMLA EMP - paid
    123---17/02/2009---8.0---malades---PAYE
    123---18/02/2009---8.0---malades---PAYE
    123---30/03/2009---8.0---jure - paid
    123---21/05/2009---4.0---malades---PAYE
    123---22/05/2009---4.0---malades---PAYE
    123---03/07/2009---8.0---malades---PAYE
    123---25/08/2009---8.0---FMLA EMP - paid
    123---26/08/2009---4.5---FMLA EMP - paid
    123---21/09/2009---8.0---malades---non paid
    123---22/09/2009---8.0---malades---non paid


    I need to consolidate absences consecutive full day (8 hours) and show Start_dt, End_Dt, and also to calculate the duration of the absence in days, hours, min. If there is lack of half day (single or consecutive) is not followed by 8 hours, then they should be considered as a new incident (5/21 and 5/22). If the absence of half-day is followed by the absence of all day while they should be grouped together (8/25 and 8/26).

    So for the data mentioned above the result should look like:

    EMP_ID - START_DT - END_DT - DAYS - HOURS - minutes - INCIDENT - REASON - PAID
    ===---====== ---- ====== -- === - ==== - === - ====== - ====== -- -- =======
    123 4 06/01/2009-01/09/2009 - 0---0---1 - disease - paid
    123-16/01/2009 1-16/01/2009 - 0---0---2 - FMLA EMP - paid
    123 2 17/02/2009-02/18/2009 - 0---0---3 - disease - paid
    123 03/30/2009 1-30/03/2009 - 0---0---4 - Jury service - paid
    123 21/05/2009 0 - 21/05/2009 - 4---0---5 - disease - paid
    123 22/05/2009 0 - 22/05/2009 - 4---0---6 - disease - paid
    123 03/07/2009 1-2009-03-07 - 0---0---7 - disease - paid
    123-25/08/2009 1-08/26/2009 - 4-30-8 - EMP - paid FMLA
    123 21/09/2009-22/09/2009-2-0-0-9 - disease - unpaid

    I am able to group them to gether and get start_dt, end_dt and total days, hours as well as incident to help

    Work_Dt - Row_Number() over (order of MIN (Work_Dt) and)
    Row_Number() (order MIN (Work_Dt)

    but it includes absences consecutive half-day (5/21 and 5/22) together as a single incident that should be considered as separate incidents. any idea or help in this case will be a great help.

    Thank you

    Stéphane wrote:

    I'm trying to calculate and history of lack of list based on the details of lack follows.

    As promised:

    with t as (
               select 123 EMP_ID,to_date('01/06/2009','mm/dd/yyyy') WORK_DT,8.0 HRS,'Sick' REASON,'Paid' PAID from dual union all
               select 123,to_date('01/07/2009','mm/dd/yyyy'),8.0,'Sick','Paid' from dual union all
               select 123,to_date('01/08/2009','mm/dd/yyyy'),8.0,'Sick','Paid' from dual union all
               select 123,to_date('01/09/2009','mm/dd/yyyy'),8.0,'Sick','Paid' from dual union all
               select 123,to_date('01/16/2009','mm/dd/yyyy'),8.0,'FMLA EMP','Paid' from dual union all
               select 123,to_date('02/17/2009','mm/dd/yyyy'),8.0,'Sick','Paid' from dual union all
               select 123,to_date('02/18/2009','mm/dd/yyyy'),8.0,'Sick','Paid' from dual union all
               select 123,to_date('03/30/2009','mm/dd/yyyy'),8.0,'Jury Service','Paid' from dual union all
               select 123,to_date('05/21/2009','mm/dd/yyyy'),4.0,'Sick','Paid' from dual union all
               select 123,to_date('05/22/2009','mm/dd/yyyy'),4.0,'Sick','Paid' from dual union all
               select 123,to_date('07/03/2009','mm/dd/yyyy'),8.0,'Sick','Paid' from dual union all
               select 123,to_date('08/25/2009','mm/dd/yyyy'),8.0,'FMLA EMP','Paid' from dual union all
               select 123,to_date('08/26/2009','mm/dd/yyyy'),4.5,'FMLA EMP','Paid' from dual union all
               select 123,to_date('09/21/2009','mm/dd/yyyy'),8.0,'Sick','Unpaid' from dual union all
               select 123,to_date('09/22/2009','mm/dd/yyyy'),8.0,'Sick','Unpaid' from dual
              )
    select  EMP_ID,
            MIN(WORK_DT) START_DT,
            MAX(WORK_DT) END_DT,
            TRUNC(SUM(HRS) / 8) DAYS,
            TRUNC(MOD(SUM(HRS),8)) HOURS,
            MOD(SUM(HRS),1) * 60 MINs,
            INCIDENT,
            REASON,
            PAID
      from  (
             select  EMP_ID,
                     WORK_DT,
                     HRS,
                     REASON,
                     PAID,
                     sum(start_of_incident) over(partition by EMP_ID order by WORK_DT) INCIDENT
               from  (
                      select  t.*,
                              case
                                when     lag(WORK_DT,1,WORK_DT) over(partition by EMP_ID order by WORK_DT) = WORK_DT - 1
                                     and
                                         lag(HRS,1,8) over(partition by EMP_ID order by WORK_DT) = 8
                                     and
                                         lag(REASON,1,REASON) over(partition by EMP_ID order by WORK_DT) = REASON
                                     and
                                         lag(PAID,1,PAID) over(partition by EMP_ID order by WORK_DT) = PAID
                                  then 0
                                else 1
                              end start_of_incident
                        from  t
                     )
            )
      group by EMP_ID,
               INCIDENT,
               REASON,
               PAID
      order by EMP_ID,
               INCIDENT
    /
    
        EMP_ID START_DT   END_DT           DAYS      HOURS       MINS   INCIDENT REASON       PAID
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------------ ------
           123 01/06/2009 01/09/2009          4          0          0          1 Sick         Paid
           123 01/16/2009 01/16/2009          1          0          0          2 FMLA EMP     Paid
           123 02/17/2009 02/18/2009          2          0          0          3 Sick         Paid
           123 03/30/2009 03/30/2009          1          0          0          4 Jury Service Paid
           123 05/21/2009 05/21/2009          0          4          0          5 Sick         Paid
           123 05/22/2009 05/22/2009          0          4          0          6 Sick         Paid
           123 07/03/2009 07/03/2009          1          0          0          7 Sick         Paid
           123 08/25/2009 08/26/2009          1          4         30          8 FMLA EMP     Paid
           123 09/21/2009 09/22/2009          2          0          0          9 Sick         Unpaid
    
    9 rows selected.
    
    SQL>  
    

    SY.

  • Select the lists to the hours, Minutes and seconds

    Apex 3.2

    I need to create 3 selection lists.

    One for the hour (24 hours)

    One for the minutes

    One for seconds

    I couldn't just create selection lists in components that are shared using static values.

    Is there a way to get the values using a select statement?

    Gus

    Hello

    Try for example

    SELECT 0 + LEVEL AS HH24
    FROM DUAL
    CONNECT BY LEVEL <= 24
    

    Kind regards

    Jari

  • How to add days, hours, minutes and seconds to a date?

    Hello

    I have the following problem.
    Saw 4 integers D, H, M, and S (each of them can be negative) and a date Da, I want to add days D, H hours, M minutes and seconds of S date Da.
    For example, if
    Da= to_date('28/06/2011 14:50:35','dd/mm/yyyy HH24:mi:ss'), and D = 3, H = -2, M = 20 and S = -12, 
    This means that I want to add 3 days, -2 hours, 20 minutes and -12 seconds to the date Da, and the new date must be in the following date:
    to_date('01/07/2011 13:10:23','dd/mm/yyyy HH24:mi:ss') 
    Is it possible to write a query for this problem or should I use PL/SQL?

    Thank you.

    There is no need of PL/SQL

    SQL> alter session set nls_date_format = 'DD/MM/YYYY HH24:MI:SS';
    
    Session altered.
    
    SQL> var d number
    SQL> var h number
    SQL> var m number
    SQL> var s number
    SQL> exec :d := 3; :h := -2; :m := 20; :s := -12
    
    PL/SQL procedure successfully completed.
    
    SQL> select to_date('28/06/2011 14:50:35','dd/mm/yyyy HH24:mi:ss')
      2     + :d
      3     + (:h / 24)
      4     + (:m / 24 / 60)
      5     + (:s / 24 / 60 / 60)
      6  from dual;
    
    TO_DATE('28/06/2011
    -------------------
    01/07/2011 13:10:23
    

Maybe you are looking for