Calculate the no. of hours

I have table named as ENTRY as follows:
ENTRY
ID       NAME    FOR_DT          IN_OUT    TIME
1         AAA     11-20-2012      IN            20-11-2012 09:20:42 AM
2         BBB      11-20-2012      OUT         20-11-2012 09:20:42 AM
How to calculate the difference in hours for the NAME AAA and BBB for particular date i.e FOR_DT ?
Note :- The difference will be the no. of hours AAA has performed his duty for the date FOR_DT
Sanjay

There are several ways to calculate time differences.
See:
http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551242712657900129
for a 'classic example'.
Other functions that you can use are EXTRACT and /or NUMTODSINTERVAL.
Search this forum for many examples.
Too bad you did not post create table and insert into statement, since now we do not know the datatype of your column.
Suggest to read and search the following links, to find more explanations and examples:
{message:id=9360002}
http://www.oracle.com/pls/db112/homepage (search box = at upper left corner)

Similar Messages

  • Calculate the performance of an activity according to the hours worked

    Hi for all,
    I need to calculate the performance of an activity according to the hours worked by anyone. Someone could tell me how can I do this?
    timetable of staff
    ID  HR1  HR2  HR3  HR4   DAY
    1   492  720  780  1080  Monday
    1   612  720  780  1200  Tuesday
    1   492  720  780  1080  Wednesday
    1   612  720  780  1200  Thursday
    1   492  720  780  1080  Friday
    2   492  720  780  1080  Monday
    3   492  720  780  1080  Saturday
    SQL> Select to_date(to_char(trunc(sysdate) + 492/1440,'dd/mm/yyyy HH24:MI:SS' ), 'dd/mm/yyyy HH24:MI:SS') from dual;
    TO_DATE(TO_CHAR(TRUNC(SYSDATE)
    20/01/2011 08:12:00
    Table Holidays
    ID DATE_HOLIDAY HOLIDAY
    1  01/01/2011   Holiday X
    1  03/15/2011   Holiday Y
    1  07/04/2011   Holiday Z
    2  01/01/2011   Holiday X
    Input Values
    Start Date : 17/01/2011
    Qtd Days   : 0
    Qtd Hours  : 11
    Qtd Minutes: 0
    Result
    18/01/2011 13:24Regards,

    Okay here is my second attempt.
    With schedule_of_work As
         Select 1 ID, 492 HR1, 720 HR2, 780 HR3, 1080 HR4, 'Monday'    Day_of_week from dual union all
         Select 1 ID, 612 HR1, 720 HR2, 780 HR3, 1200 HR4, 'Tuesday'   Day_of_week from dual union all
         Select 1 ID, 492 HR1, 720 HR2, 780 HR3, 1080 HR4, 'Wednesday' Day_of_week from dual union all
         Select 1 ID, 612 HR1, 720 HR2, 780 HR3, 1200 HR4, 'Thursday'  Day_of_week from dual union all
         Select 1 ID, 492 HR1, 720 HR2, 780 HR3, 1080 HR4, 'Friday'    Day_of_week from dual
    ), parameters AS
            /* Creating a single row of input values that can be used multiple times */
            SELECT TO_DATE(:job_start_date,'MM/DD/YYYY HH24:MI')             AS job_start_date
                 , TRUNC(TO_DATE(:job_start_date,'MM/DD/YYYY HH24:MI'),'IW') AS beginning_of_week
                 , NVL(:days,0)
                 + NVL(:hours,0)/24
                 + NVL(:minutes,0)/(60*24)                                   AS job_length
            FROM   dual
    ), holidays AS
            SELECT TO_DATE('01/01/2011','MM/DD/YYYY') AS dt FROM DUAL
    ), date_range AS
            /* Trying to generate a date range that should encompass the maximum date it would take
             * to complete the task. Rough estimate is number of 8 hour work days plus a padding of 10 days.
             * You may want to adjust this to something more suitable for your business or set it to an artificially
             * high value. Be aware of possible performance implicications the higher you set it.
            SELECT TRUNC(job_start_date) + (ROWNUM - 1) AS dts
            FROM   parameters
            CONNECT BY ROWNUM <= TRUNC(job_length*24/8) + 10
    ), schedule_as_dates AS
            SELECT sowo.id
                 , sowo.day_of_week
                 , dara.dts
                 , holi.dt
                 , CASE
                        /* Only perform the effective hours when the day is not a holiday
                        * and it matches a date in the date range. Otherwise set effective hours to midnight
                        * making the running sum below zero.
                      WHEN sowo.day_of_week IS NOT NULL AND holi.dt IS NULL
                       THEN dara.dts + HR1/(60*24)
                       ELSE dara.dts
                   END                                    AS start1
                 , CASE
                       WHEN sowo.day_of_week IS NOT NULL AND holi.dt IS NULL
                       THEN dara.dts + HR2/(60*24)
                       ELSE dara.dts
                   END                                    AS end1
                 , CASE
                       WHEN sowo.day_of_week IS NOT NULL AND holi.dt IS NULL
                       THEN dara.dts + HR3/(60*24)
                       ELSE dara.dts
                   END                                    AS start2
                 , CASE
                       WHEN sowo.day_of_week IS NOT NULL AND holi.dt IS NULL
                       THEN dara.dts + HR4/(60*24)
                       ELSE dara.dts
                   END                                    AS end2
            FROM      date_range       dara
            LEFT JOIN schedule_of_work sowo PARTITION BY (sowo.id) ON sowo.day_of_week = TO_CHAR(dara.dts,'FMDay','NLS_DATE_LANGUAGE=English')
            LEFT JOIN holidays         holi                        ON holi.dt          = dara.dts
    SELECT
           CASE
           /* This means that we need to go into the second shift (start2-end2) to calculate the end date */
           WHEN  work_remaining > end1 - start1
           THEN  start2 + work_remaining - ( end1 - start1 )
           /* This means we can complete the work in the first shift */
           WHEN  work_remaining < end1 - start1
           THEN  start1 + work_remaining
           END   AS finish_time
    FROM
            SELECT b.*
                 /* Determine how much work is remaining from the previous days value */
                 , job_length - prev_work_time                               AS work_remaining
                 /* Calculate the smallest delta value to pick the right day of the week
                    to calculate the end date
                 , ROW_NUMBER() OVER (partition by B.ID ORDER BY DELTA desc) AS RN
            FROM
                    SELECT a.*
                         /* This computation is used to determine which day of the week we need to use
                            to determine the end date of the task
                         , job_length - effective_work_time AS delta
                         /* retrieve the previous effective_work_time. This will be used above */
                         , LAG(effective_work_time) OVER (PARTITION BY ID order by start1) AS prev_work_time
                    FROM
                            SELECT job_start_date
                                 , job_length
                                 , id
                                 , day_of_week
                                 , start1
                                 , end1
                                 , start2
                                 , end2
                                  /* Compute the amount of time an employee can work in any given day. Then take a running total of this */
                                 , SUM
                                     CASE
                                         /* When the job_start_date is the same day as the first eligible work day we need to diskount (spam filter misspelled on purpose the
                                          * effective work hours because the job could start in the middle of the day.
                                         WHEN TRUNC(job_start_date) = TRUNC(start1)
                                         THEN
                                              CASE
                                                   WHEN job_start_date BETWEEN start1 AND end1
                                                   THEN (end1 - job_start_date) + (end2 - start2)
                                                   WHEN job_start_date BETWEEN start2 AND end2
                                                   THEN (end2 - job_start_date)
                                                   WHEN job_start_date < start1
                                                   THEN (end2 - start2) + (end1 - start1)
                                                   WHEN job_start_date > end2
                                                   THEN 0
                                              END
                                         ELSE (end2 - start2) + (end1 - start1)
                                     END
                                 ) OVER (PARTITION BY ID order by start1) AS effective_work_time
                            FROM       schedule_as_dates
                            CROSS JOIN parameters
                    ) a
            ) b
            /* Only interested in delta less than zero because the positive deltas indicate more work needs to be done. */
            WHERE delta < 0
    WHERE RN = 1I got slightly different results then you. My query got me 1/24/2011 at 13:12. I double checked the math and I think that's right.
    Hopefully this works out for you. My apologies for any mistakes.
    EDIT
    Query is fully posted now.

  • How to calculate the salary of the employees when they are differentiated by monthly and hourly basis

    Hi all
    How to calculate the salary of the employees when they are differentiated by monthly and hourly basis
    How can we write the logic though sql
    Thanks in advance

    (case when pay_basis like 'HOURLY'
    then PROPOSED_SALARY_N*pay_annualization_factor
    when pay_basis like 'ANNUAL'
    then PROPOSED_SALARY_N*pay_annualization_factor
    end )
    I was actually trying to write the logic in this way but it was not calculating in correct format for hourly paid employees

  • How to calculate the hour difference between two dates?

    hi all,
    how to calculate the hour difference between two dates?
    eg i trying this...
    ((TO_DATE(TO_CHAR(GRNi.reference_date_4,'hh24:mi'),'hh24:mi') -
    TO_DATE(TO_CHAR(NVL(GRNi.reference_date_3,SYSDATE),'hh24:mi'),'hh24:mi'))*24)*60 Act_Hr
    Reg.
    AAK

    Hi
    To break the diff between 2 dates into days, hours, minutes, sec -- you can use the following:
    select to_char( created, 'dd-mon-yyyy hh24:mi:ss' ),
    trunc( sysdate-created ) "Dy",
    trunc( mod( (sysdate-created)*24, 24 ) ) "Hr",
    trunc( mod( (sysdate-created)*24*60, 60 ) ) "Mi",
    trunc( mod( (sysdate-created)*24*60*60, 60 ) ) "Sec",
    to_char( sysdate, 'dd-mon-yyyy hh24:mi:ss' ),
    sysdate-created "Tdy",
    (sysdate-created)*24 "Thr",
    (sysdate-created)*24*60 "Tmi",
    (sysdate-created)*24*60*60 "Tsec"
    from all_users
    where rownum < 50
    HTH
    RangaReddy

  • How to calculate the total of absences? How to collect data from a specific line of a table?

    Hi,
    Again, I made a nice coloured picture from a screen capture which summarise the improvements that I would like to make in my form,
    Situation:
    For an educational purpose, I made this form   to simplify the way of recording the data and also to develope the independence of the students.
    ( I am doing this on a voluntary basis, working extra hours on my free time but I don't really mind because I am learning a lot of things in the same time)
    After being tested by the teacher, the student has to record the short date, the lines memorised, his grade, number of mistakes, and his attendance.
    I created everything in Word, then converted the file in PDF, then I created all the different fields with Adobe acrobat.
    There is in total 4 sheets, there are all similar except the first one in which there is a box with: date started, date finished, total time spent, absences.
    Below this box there is a table with 16 lines from (A to P) and 7 columns (Days, Date, From.. to.. , Grade, No. lines memorised, No. Errors, Attendance) ( so this table is present on all the sheets)
    Due to the fact that some students need more time than others, and also beacause some text need more time, I estimated a need of 4 sheets at the very most.
    I would like to make the following amelioration and automate the inputting of some of the data because I know that some of the students will certainly forget, so to avoid this scenario I am trying to make this form the easiest possible.
    screen capture of the form:
    screen capture of the form editing, you can see the names of the different fields:
    here is the form (only the first page) : http://cjoint.com/12fe/BBotMMgfYIy_memorisation_sheet_sample.pdf
    In  yellow 00000:
    At present, the students has to input the total of absences manually, is there a way ( script) to automate this by initialising the field next to "Absences" at  " 0 day"   and then everytime that Absent is selected from the COMBO BOX, it add 1 and it is displayed like this:  " 1 day" then " 2 days"  then " 3 days" etc … (so from what I read I have to initialise a counter a the beginning and then for (i...   ) count= count++; something like this...
    Furthermore, I need a solution to overcome the possibility that a second sheet may be needed for the same student; therefore I would need the data from the "attendance column" from the second sheet ( and perhaps the 3rd and 4th aswell) to be added on the "absences field" in the first sheet
    My idea: everytime that the short date is inputted in the first line (next to A) in the "Date" column of one of the 4 sheets then we check the 16 Combo box of the attendance column in this sheet instead to check 16*4=64 fields fot the 4 sheets in one go?
    but I don't know at all how to write it in Javascript. Or perhaps there is a way more easier than that?
    Shall I allocate a value for Absent on the “ export value”?
    In purple
    At present I wrote a simple script which matches the number of lines to the poem selected (Eg.  if I select the poem V.Hugo,  the number "36" will appear next to Number of lines).
    Again I would like the make the life of the students very easy so I would like a script which detects this number “36” on the "From .. to …" column,  as soon it is detected (on the first sheet or 2nd or 3rd or 4th)  check from the same line if "A / Pass" or "B / Pass" have been selected in the "Grade" column ,if yes the short date inputted on this line will be written on the field next to "Date finished" .
    this is a simple example with 36 lines only but somethimes, the students may have to memorise 80 lines and more, this is the reason for having 4 sheets in total.
    So basically I would like to automate the field next to" Date finished:" with a script that collect the short date from the day in which the student has finished his memorisation with "A / Pass" or "B / Pass"
    As for the "Total time spent" George Johnson helped me with a script that calculate the difference betwen date started and date finished (thank you)
    I am sollicting your help, because after trying for hours I was really confused with the different if/else needed. And in top of that, it’s my first experience with Javascript.
    I anticipate your assistance, thanking you in advance.

    I found this for counting the absences, its give you the total that's perfect, but is there a better methode which avoid me to write all the fields name, more simple????
    ( I found the idea here : Re: Total number added automatically  )
    // custom calculation script for field "Total #"
    function CountFields(aFields) {
    var nFields = 0;
    for(i = 0; i < aFields.length; i++) {
    try {
    // count null values, export value of Absence is 0;
    if(this.getField(aFields[i]).value == "0") nFields++;
    } catch(e) {
    if(e['message'] == "this.getField(aFields[i]) has no properties") app.alert("unknown field name: " + aFields[i]);
    else app.alert(e.toString());
    } // end catch
    } // end for aFields
    return nFields;
    // create array of field names to count
    var aNames = new Array("Sheet1AttendanceA","Sheet1AttendanceB","Sheet1AttendanceC","Sheet1AttendanceD","Sh eet1AttendanceE","Sheet1AttendanceF",
    "Sheet1AttendanceG","Sheet1AttendanceH","Sheet1AttendanceI","Sheet1AttendanceJ","Sheet1Att endanceK","Sheet1AttendanceL",
    "Sheet1AttendanceM","Sheet1AttendanceN","Sheet1AttendanceO","Sheet1AttendanceP" );
    // count the non-null fields;
    event.value = CountFields(aNames);
    As for the 2nd question, I've tried to do something similar to the previous script, but of course it doesn't work, but I am quite sure that the idea is similar:
    I don't know also how to add the other condition: the student should get A / Pass or B / Pass in order to consider he has finished??? and also how to check these condition from page 2, 3 and 4 and collect the date
    function Datefinished(bFields) {
    d2.value = nFields[i].value;
    for(i = 0; i < aFields.length; i++) {
    try {
    if(this.getField(aFields[i]).value == this.getField("NumberLines").value) d2.value = nFields[i].value;
    } catch(e) {
    if(e['message'] == "this.getField(aFields[i]) has no properties") app.alert("unknown field name: " + aFields[i]);
    else app.alert(e.toString());
    } // end catch
    } // end for aFields
    return nFields;
    // create array of field names to check
    var aNames = new Array("Texte00","Texte54","Texte56","Texte58","Texte60","Texte62","Texte64","Texte66","Te xte68","Texte70","Texte72","Texte74","Texte76","Texte78","Texte80","Texte82");
    var bNames = new Array("d1","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14 ","d15","d16","d17");   // d1 is included because in some cases a student can finish in 1 day (short text);

  • How to calculate the duration/age of a work request.

    I need to calculate the actual resolution time in 'Days:Hours:Minutes' format, for the work requests which are being worked upon by the engineers working in my team. I am using MS-Excel (MS-Office 2013) for reporting. The tool from which I am exporting
    the details shows the Open and Resolved time as MM/DD/YYYY HH:MM:SS (3/20/2015 10:32:16 AM). I am sure this is one of the thing which is not that difficult and many reporting people are doing this. Thanks in advance for the assistance.
    Regards, Ankit Arora

    Let's say that the Open date/time is in A2 and the Resolved date/time in B2.
    The formula for the resolution time is =B2-A2
    Format the cell with the formula with the custom number format d:hh:mm
    This will work as long as the number of days is at most 31.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to calculate the time duration on a datetime column?

    Hi guys,
    I've done some search on this forum and everywhere else but I can't seem to get this right, at the beggining it sounded like something very simple to accomplish, for the instance with Excel but I'm struggling to get it to work with Crystal Reports on Microsoft Visual Studio 2008.
    I have a datetime column (SQL Server 2000) that I wanted to calculate the the time duration on the report group footer, unfortunatelly the built-in SUM function cannot be applied and I've tried several formulas that I've found on the internet without any luck. I'm using a datetime column to store only the time because I'm stuck with SQL Server 2000 which doesn't have a time data type.
    Would you guys know how to do it by any chance?
    Some sample code I've tried: http://www.minisolve.com/TipsAddUpTime.htm
    Thanks a lot,
    Paul
    Edited by: Paul Doe on Dec 12, 2009 5:41 PM
    Some sample data:
    EMPLOYEE     WORK HOURS
    =========     =================
    JOHN DOE      1900-01-01 01:00:05
    JOHN DOE      1900-01-01 00:20:00
    JOHN DOE      1900-01-01 01:30:15
    =========     =================
    HOURS WORKED: 02:50:20
    Edited by: Paul Doe on Dec 12, 2009 5:42 PM
    Edited by: Paul Doe on Dec 12, 2009 5:45 PM

    Guess what, by further testing the code on the website mentioned above I got it working.
    Pus, I needed to change the grouping on the code, so I had to come up with a way to update the formulas based on the groupping field.
    Considering "call_date" is the field that you are groupping by on the designer use the following code to update the formula:
    CrystalReportObj = new ReportDocument();
    CrystalReportObj.Load("C:\\reportfile.rpt");
    FieldDefinition FieldDef;
    //Get formula
    FormulaFieldDefinition FormulaDef1;
    FormulaDef1 = CrystalReportObj.DataDefinition.FormulaFields["SubHours"];
    //Get formula
    FormulaFieldDefinition FormulaDef2;
    FormulaDef2 = CrystalReportObj.DataDefinition.FormulaFields["subMinSec"];
    //Update the formula to work with the new grouping field,
    //this must be called first else will throw an exception
    FormulaDef1.Text = FormulaDef1.Text.Replace("call_date", "call_extension");
    FormulaDef2.Text = FormulaDef2.Text.Replace("call_date", "call_extension");
    //Get the new field we are grouping by
    FieldDef = CrystalReportObj.Database.Tables[0].Fields["call_extension"];
    //Replace current grouping field with the new one,
    //considering there only one group in the report, index 0
    CrystalReportObj.DataDefinition.Groups[0].ConditionField = FieldDef;
    Have fun.
    Edited by: Paul Doe on Dec 12, 2009 8:43 PM
    Edited by: Paul Doe on Dec 12, 2009 8:53 PM

  • How to use the manually entered Hours/Days in the Duration field for BG_ABSENCE_DURATION

    Hi All,
    How to use the manually entered Hours/Days in the Duration field for BG_ABSENCE_DURATION fast formula?
    Requirement is to restrict employees for applying for leave more than the accrued balance. In SSHR, apply leave functionality, the employee enters the start date, end date and duration manually. The entered duration must be used in the fast formula to check against available balance.
    In the BG_ABSENCE_DURATION FF, I have a function to calculate the net accrual balance as on the calculation date.
    I want to add the logic as - If to_number(Duration) /*[manually entered value]*/ > net accrual balance then
    Duration = 'FAILED'
    invalid_msg = 'Error'
    return duration, invalid_msg
    Thanks!

    Hi,
    We have a standard functionality to override the duration calculation and you don't need to add a validation for the same. Please set the value of profile option HR: Absence Duration Auto Overwrite to Yes
    When you do this user will not have to enter the duration value manually. It will get auto calculated based on the duration calculation in BG_ABSENCE_DURATION when you click on the next button.
    For not allowing negative leaves to be applied, If you are on R12 then, this is a standard functionality and you need to set profile option HR Allow Absence Negative Balance to No
    If you are on 11i then refer Note: 268171.1: How Do You Stop Accrual Plans from Going Negative?
    Try and let me know in case you need further help.
    Thanks,
    Sanjay

  • How to calculate the key figure value on other key figure

    Hi,
    I have a material character and  Packing Hour, No of Boxes key figures. My requirement is i need to calculate the % no of boxes are Packed <2 Hour , 2 to 3 Hour and above 4 hour based on the packing hour.
    Sample data
    Material     Packing hour    No of boxes
    001            1 hr                   5 box
    002            2 hr                   3 box
    003            2hr                    7 box
    004            3hr                    2 box
    005            5hr                    1 box
    Here  we are not considering meterial. We are considering Only Packing hour and no of box  to calculate % no of Boxes within a time period. Please help me out...to calculate % no of boxes based on hour period
    Thanks,
    Rama Devi

    hi
    its like creating buckets for analysis...
    u'll have to create  formula in KF...
    1.
    if (Pack Hrs <= 2) * No Of Boxes
    2.
    If (Pack Hr >= 3 or Pck Hr <= 4) * No Of Boxes
    like this u'll have to create bucket..

  • Workflows: How to set a workflow variable that is the difference in hours between now and a created date

    I'm trying to create a variable that contains the number of hours between the item created date and Now.  When i use TODAY, it seems to set the time at 12:00 rather than the time now - so that throws the hours off.  Any ideas?
    ajw

    Hi ajw,
    According to your description, my understanding is that you want to calculate the hours between the item created date and now.
    It seems to be not an OOB way to implement your requirement, to get the current time, you need to create a custom workflow activity for SharePoint 2010 workflow. About creating custom workflow activity, you can refer to the links below:
    http://msdn.microsoft.com/en-us/library/hh872790(v=office.14).aspx
    http://blogs-sharepoint-ashutoshmisra.blogspot.in/2013/02/create-custom-workflow-action-for.html
    Or, you can use a third party solution to achieve your requriement.
    Here are some similar posts for you to take a look at:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/e93ea37a-df09-4cbf-a58d-5d4def3d3d42/how-to-compare-time-in-sharepoint-designer-2010sp-2010-workflow?forum=sharepointgeneralprevious
    http://blog-sharepoint.blogspot.in/2009/03/get-current-time-in-sharepoint-designer.html
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How do you calculate difference in time (hours and minutes) between 2 two date/time fields?

    Have trouble creating formula using FormCalc that will calculate difference in time (hours and minutes) from a Start Date/Time field and End Date/Time field. 
    I am using to automatically calculate total time in hours and minutes only of an equipment outage based on a user entered start date and time and end date and time. 
    For example a user enters start date/time of an equipment outage as 14-Oct-12 08:12 AM and then enters an end date/time of the outage of 15-Oct-12 01:48 PM.  I need a return that automatically calculates total time in hours and minutes of the equipment outage.
    Thanks Chris

    Hi,
    In JavaScript you could do something like;
    var DateTimeRegex = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d)/;
    var d1 = DateTimeRegex.exec(DateTimeField1.rawValue);
    if (d1 !== null)
        var fromDate = new Date(d1[1], d1[2]-1, d1[3], d1[4], d1[5]);
    var d2 = DateTimeRegex.exec(DateTimeField2.rawValue);
    if (d2 !== null)
        var toDate = new Date(d2[1], d2[2]-1, d2[3], d2[4], d2[5]);
    const millisecondsPerMinute = 1000 * 60;
    const millisecondsPerHour = millisecondsPerMinute * 60;
    const millisecondsPerDay = millisecondsPerHour * 24;
    var interval = toDate.getTime() - fromDate.getTime();
    var days = Math.floor(interval / millisecondsPerDay );
    interval = interval - (days * millisecondsPerDay );
    var hours = Math.floor(interval / millisecondsPerHour );
    interval = interval - (hours * millisecondsPerHour );
    var minutes = Math.floor(interval / millisecondsPerMinute );
    console.println(days + " days, " + hours + " hours, " + minutes + " minutes");
    This assumes that the values in DateTimeField1 and DateTimeField2 are valid, which means the rawValue will be in a format like 2009-03-15T18:15
    Regards
    Bruce

  • How do I calculate the difference between two times?

    I am so embarrassed by the fact that I can't figure this out.
    Cell B2- 8:00 am
    Cell C2- 10:50 am
    Cell D2- (How do I get this cell to calculate the difference and say 2:50?)
    I know this is probably one of the most basic operations, but for the life of me I can't figure it out. Cells B2 & C2 are formatted for 24 hour clock. But if I tell the system to just subtract the two, I get "0.118". Everything I find on the forum search goes beyond what I need. Can anyone help me?
    Thank you.

    KOENIG Yvan wrote:
    Numbers states clearly in the Help and the PDF Users Guide that it doesn't know a "duration" object but a time one which is restricted to the range 00:00:0 to 23:59:59.
    When I search the U.S. language Numbers User Guide for the word "duration," it is not found.
    What may be more clear: _duration is not available but time is_?
    Once again your response resemble to a rant againt the Help and the User Guide.
    In the Help:
    +date-time Any Numbers date/time value. _While you can choose to display only date or time in a cell, all Numbers date or time values contain both the date and time._+
    Which wording would be more clear and precise?
    TIMEVALUE
    +The TIMEVALUE function converts a date, a time, or a text string to _a decimal fraction of a 24-hour day._+
    Which wording would be more clear and precise?
    TIME
    +The TIME function converts hours, minutes, and seconds into a time format.+
    +TIME(hours, minutes, seconds)+
    +hours: The number of hours _(using a 24-hour clock)._+
    +minutes: The number of minutes.+
    +seconds: The number of seconds.+
    Notes
    +You can specify hour, minute, and second values greater than 23, 59, and 59, respectively. _If the hours, minutes, and seconds add up to more than 24 hours, Numbers subtracts 24 hours repeatedly until the sum is less than 24 hours._+
    Which wording would be more clear and precise?
    In the User Guide:
    page 190
    +date-time Any Numbers date/time value. _While you can choose to display_+
    +_only date or time in a cell, all Numbers date or time values contain_+
    +_both the date and time._+
    +TIME (page 277) Converts a time to a decimal fraction of a 24-hour day.+
    +TIMEVALUE (page 278) Converts a time in a string to a decimal fraction of a 24-hour day.+
    TIME
    +The TIME function converts the specified time to a decimal fraction of a 24-hour day.+
    +TIME(hours, minutes, seconds)+
    +• hours: The number of hours _(using a 24-hour clock)_.+
    +• minutes: The number of minutes.+
    +• seconds: The number of seconds.+
    Notes
    +You can specify hour, minute, and second values greater than 23, 59, and 59,+
    +respectively. _If the hours, minutes, and seconds add up to more than 24 hours,_+
    +_Numbers subtracts 24 hours repeatedly until the sum is less than 24 hours._+
    +You can also specify fractional values for hours, minutes, or seconds.+
    TIMEVALUE
    +The TIMEVALUE function converts a time in a string to a decimal fraction of a 24-hour+
    day.
    TIMEVALUE(date-time)
    +• date-time: A date, a time, or a string in any of the Numbers date and time formats.+
    As you may check, the infos are exactly the same in the Help and in the Guide.
    And I really don't understand how you may find them unclear.
    Yvan KOENIG (from FRANCE lundi 4 août 2008 14:57:36)

  • How to calculate the Time difference between 2 dates

    HI All,
    I am using HR_hk_diff_btw_2_dates to calculate the employee service dates.
    For that i  am inputing his hire date and Term dates and Output format as '05' i am getting output perfectly....
    But problem is  whe i am inputting the employee hire date is Dec 1 2007 and Term date is
    March 31 2009 It is coming as 1 year 3 months  31 days instead of 1 year 4 months directly .......How could we make it make last date also working day and get the O/p as 1 year 4 months ?Please Advice..
    Regard
    sas

    1. FM for difference betwwen two times:SCOV_TIME_DIFF
    Import parameters               Value
    IM_DATE1                        2008-01-01
    IM_DATE2                        2008-01-01
    IM_TIME1                        10:00:00
    IM_TIME2                        11:30:00
    Export parameters               Value
    EX_DAYS                         0
    EX_TIME                         01:30:00
    2. SD_CALC_DURATION_FROM_DATETIME : Finds the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Finds the time difference between two date/time

  • What is the fastest way to calculate the rms voltage from a large voltage measurement file?

    I have collected voltage measurements for a 60Hz waveform and would like to calculate the RMS voltage in order to determine voltage drift. The data was collected at 100KHz and the TDMS file is 4 hours long (a huge amount of data!). I have run the RMS tool in the basic mathematics block with small sets of data successfully, but the large set seems to take forever to run (48 hours so far and it hasn't finished yet).
    1. Is there a faster way to analyze this much data?
    2. How does the "one sided interval width" affect my results and analysis time?
    3. Can I calculate the RMS voltage with FFT?
    4. Is there a way to redce the size of my data file to a manageable size file so the RMS function will run quickly, yet maintain accuracy?

    Hi Dave,
    Just a thought, If you have a 60 Hz signal, then the 100 Khz is way overkill for the sampling rate,   If you would resample the waveform at  say 20 X 60 hz= 1200 Hz you should have the same details  that would be in the 100 Khz sample signal.  That should take substantially less time to do a RMS calculation on the resampled channel. The two commands are listed below. 
    ChnResampleChnBased
    ChnResampleFreqBased
    Paul

  • Calculate difference from last hour ?

    hello all,
    I have a sql query like below...
    SELECT sn.snap_time, st.value
    FROM PERFSTAT.STATS$SYSSTAT st, PERFSTAT.STATS$SNAPSHOT sn
    WHERE st.snap_id = sn.snap_id
    and st.NAME = 'user calls'
    and sn.snap_time > to_date('03/01/2011 10:00:00', 'mm/dd/yyyy hh24:ss:mi')
    order by 1 desc
    and output is below....
    SNAP_TIME VALUE
    19-DEC-11 08:0:00 123501120
    19-DEC-11 07:0:00 121336929
    19-DEC-11 06:0:01 119910473
    19-DEC-11 05:0:01 118900726
    19-DEC-11 04:0:07 118244503
    19-DEC-11 03:0:01 117202971
    19-DEC-11 02:0:01 115791474
    19-DEC-11 01:0:03 114008304
    19-DEC-11 00:0:02 111347506
    18-DEC-11 23:0:01 108291559
    18-DEC-11 22:0:02 104340139
    18-DEC-11 21:0:01 99255636
    18-DEC-11 20:0:02 92775319
    18-DEC-11 19:0:01 85262323
    18-DEC-11 18:0:01 76262794
    18-DEC-11 17:0:01 68381704
    18-DEC-11 16:0:01 60100822
    18-DEC-11 15:0:01 51855773
    18-DEC-11 14:0:01 43733973
    18-DEC-11 13:0:01 35903397
    18-DEC-11 12:0:01 28494465
    18-DEC-11 11:0:01 21724443
    18-DEC-11 10:0:02 15667617
    18-DEC-11 09:0:01 10526163
    18-DEC-11 08:0:01 6741565
    18-DEC-11 07:0:00 3622640
    18-DEC-11 06:0:01 1623214
    18-DEC-11 05:0:03 207054
    but how can i write my query in a way so i can get the actual value/difference from the hour before
    ....all the above value is cumulative and i want to calculate the value from actual time...lets say starting
    18-DEC-11 05:0:03 ...
    hope it make sense...i am on 9.2.0.5

    Hi,
    To show the difference from the previous row (where "previous" is based on snap_time, ASCendcing order):
    SELECT    sn.snap_time
    ,        st.value
    ,       st.value - LAG (st.value) OVER (ORDER BY snap_time)     AS value_change
    FROM        PERFSTAT.STATS$SYSSTAT     st
    ,        PERFSTAT.STATS$SNAPSHOT     sn
    WHERE        st.snap_id     = sn.snap_id
    AND       st.NAME     = 'user calls'
    AND       sn.snap_time     > TO_DATE ( '03/01/2011 10:00:00'
                              , 'mm/dd/yyyy hh24:ss:mi'
    ORDER BY  snap_time     DESC
    ;In yopur sample data, it looks like every row is about a hour away from its neighbors. If you missed an hour, or if you sometimes had two (or more) rows in the same hour, then what results wouold you want? Post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.

Maybe you are looking for

  • If condition in SAP Scripts?

    Hi, I have a SAP Script. In that i have one IF condition. I want to insert one more if condition in that IF condition. If first IF condition is true then it has to check for second IF condition. Can any one please help on this.syntax.. Thanks Venkate

  • Negative values on customer consignment stock

    Hello, Is it possible to have negative values on customer consignment stock? i.e. the same material is sent to a customer, as consignment stock (special stock W), from different plants. If the material is not used by the customer (then it has not bee

  • Spectral methods: Welch vs. Blackman Turkey, Which is better?

    Hello, i have a question. LabView uses to estimate the frequency response in SI-Toolkit a correologram method (Blackman-Turkey). Matlab uses with tfestimate() a periodogramm method (Welch)to estimate the Frequency response. Which is better? In some b

  • Resize image to and object in the image

    Hi, I thought this must be on the forum somewhere, but I can't find it despite trying loads of search terms. I have taken photos of some objects for scientific research and I have included rulers in the image (both vertical and horizontal) to give a

  • X groups with each 1 filter agaist same db, user member of more than 1 group

    Hi everybody !I have a problem :I have a set of groupsEach group is assigned 1 filter againstthe same databaseIt works fine, EXCEPT :When 1 user is member of more thanone group it fails with the##1054013 Syntax error loading filters - operation cance