Working hours of an employee between a given date range

Hi Everyone,
how to calculate working hours of an employee between a given date range
Please anyone qive me some idea..
Thanks in advance

Hi Lathessh,
Thanks for the reply here is the sample data. Actually we have two datetime field and i want to calculate the Ageing of an employee , by excluding of sunday and holiday between startdate and endDate.
Ageing should be in hours.   Thanks
StartDateTime
EndDateTime
HolidayList
2/24/2014 11:55
3/1/2014 16:45
1/1/13 0:00
2/24/2014 12:08
2/28/2014 12:55
1/14/13 0:00
2/24/2014 16:16
2/28/2014 15:20
1/25/13 0:00
2/14/2014 12:56
3/4/2014 16:20
3/27/13 0:00
2/14/2014 12:56
3/4/2014 16:20
3/29/13 0:00
2/14/2014 12:56
3/4/2014 16:20
4/24/13 0:00
2/14/2014 12:56
3/4/2014 16:20
5/1/13 0:00
2/26/2014 13:53
3/4/2014 16:20
8/9/13 0:00
2/27/2014 12:13
3/5/2014 13:05
8/15/13 0:00
3/3/2014 14:42
3/5/2014 17:05
8/20/13 0:00
3/3/2014 14:42
3/5/2014 17:05
8/28/13 0:00
3/3/2014 14:42
3/5/2014 17:05
9/18/13 0:00
3/6/2014 12:28
3/6/2014 17:55
10/2/13 0:00
3/6/2014 12:59
3/7/2014 13:55
10/16/13 0:00
3/6/2014 14:37
3/7/2014 11:15
11/5/13 0:00
3/6/2014 14:57
3/7/2014 12:10
11/15/13 0:00
3/4/2014 17:21
3/10/2014 15:55
12/4/13 0:00
3/4/2014 17:21
3/10/2014 15:55
12/25/13 0:00
3/6/2014 12:08
3/10/2014 14:10
12/31/13 0:00
3/6/2014 13:31
3/10/2014 13:05
1/1/14 0:00
3/6/2014 13:14
3/11/2014 13:20
1/14/14 0:00
3/6/2014 13:14
3/11/2014 13:20
3/17/14 0:00
3/11/2014 14:29
3/13/2014 11:20
4/8/14 0:00
3/11/2014 14:29
3/13/2014 11:20
4/14/14 0:00
3/12/2014 12:56
3/13/2014 11:45
4/18/14 0:00
3/12/2014 12:56
3/13/2014 11:45
5/1/14 0:00
3/12/2014 14:02
3/12/2014 18:10
7/29/14 0:00
3/12/2014 14:22
3/12/2014 18:05
8/15/14 0:00
2/24/2014 16:49
3/14/2014 12:10
8/18/14 0:00
2/24/2014 16:49
3/14/2014 12:10
8/29/14 0:00
2/24/2014 16:49
3/14/2014 12:10
10/2/14 0:00
2/24/2014 16:49
3/14/2014 12:10
10/3/14 0:00
3/12/2014 11:31
3/14/2014 15:55
10/6/14 0:00
3/12/2014 13:31
3/15/2014 12:20
10/23/14 0:00
3/12/2014 15:31
3/15/2014 11:10
10/24/14 0:00
3/12/2014 15:49
3/14/2014 13:55
12/25/14 0:00
3/12/2014 16:19
3/14/2014 15:05
12/31/14 0:00

Similar Messages

  • Need total worked hours of each employee

    Hi all
    I need the total work hour for each employee
    create table pde(empno number(10),act_hour varchar(10 byte));
    Table created
    insert into pde values(211,'12:20');
    insert into pde values(211,'06:00');
    insert into pde values(213,'07:00');
    insert into pde values(213,'07:20');
    WITH  got_total_hours     AS
         SELECT SUM (   TO_NUMBER (SUBSTR (act_hour, 1, 2))
                    + ( TO_NUMBER (SUBSTR (act_hour, 4, 2))
                      / 60
                    ) AS total_hours 
         from      pde
    SELECT        TO_CHAR (FLOOR (total_hours))
           || ':'
           || TO_CHAR ( MOD (total_hours, 1) * 60
                  , 'fm00'
                   )     AS hh_mm,empno,act_hour
    FROM     got_total_hours ,pde
    this is the output i am getting 
    HH_MM  EMPNO  ACT_HOUR
    32:40     211     12:20
    32:40     211     06:00
    32:40     213     07:00
    32:40     213     07:20
    i require    HH:MM EMPNO ACT_HOUR
                   18:20  211      12:20
                   18:20  211      06:00
                   14:20  213      07:00
                   14:20  213      07:20
    kindly help meThanking in advance
    regards,
    oracleuser

    Hi Ravi,
    Your solution works perfectly fine but there is a prob when i incorporate ur solution in the main query
    WITH temp AS
      (SELECT employee_number,
        act_hour   ,
        SUM(to_number(regexp_substr(act_hour,'[^:]+',1,1))*60+to_number(regexp_substr(act_hour,'[^:]+',1,2))) over (partition BY employee_number) tot
         FROM nap_PUNCH_DATA_EMP_LIST trn where DATE_ENTRAY between '23-Aug-2009' and  '24-Aug-2009'
    SELECT employee_number,act_hour,ROUND(tot/60)||':'||mod(tot,60) tothours FROM temp
    o/p i am getting is
    EMPLOYEE_NUMBER     ACT_HOUR             TOTHOURS
    408                            06:31                         07:31
    408                            00:00                         07:31
    410                            18:12                          30:59 ------SUM of 18:12 and 11:47 should be 29:59
    410                             11:47                          30:59
    this is working correctly for majority of employee_numbers with exception of some employee_numberskindly help
    regards,
    oracle user
    Edited by: makdutakdu on Jan 4, 2010 12:45 PM

  • How to find particular date lies in between two given dates

    hi,
    i have a problem. i have to find if particular day lies in between two given dates.
    example two dates are joindate and expirydate.
    1.joindate is 1/03/2007
    expdate is 1/03/2008
    now i have to find if 29 feb is in between this joindate and expirydate.
    if any1 has ny idea please reply asap.
    thanks.

    The Date class has a before() and after() method you can use to compare Date objects.

  • Download to excel between two given dates

    Hi All,
    I already implemented Export to Excel funtionality in webdynpro java. Now i have a requirement to download the data to Excel only between two given dates.
    I am taking two dates from the user and based on that it should download data into excel file.
    Guide me on this or send pseudocode for this.
    Regards,
    Dhruv

    Hi,
    If I understand your question correctly,
    you are gettting some data from R/3. You need to filter out that data which is in between  two given dates , export that data to excel.
    If yes, then take one more ValueNode with same structure.
    and bind the filtered data to this node.
    To filter out model node, use
    int size=wdContext.node<outputnode>().size();
    Date stDate=wdContext.currentContextElement().get<startDate>();
    Date endDate=wdContext.currentContextElement().get<endDate>();
    for(int i=0;i<size;i++)
    Date objDate=wdContext.node<outputNode>().get<outputNode>ElementAt(i).get<dateAttribute>();
    if( (objDate.compareTo(stDate)>=0) && (objDate.compareTo(endDate)<=0) )
    // Create element for value Node , set the values  (ie. i'th    record values) and add to ValueNode.
    Long process, but you can use
    Now export the ValueNode to excel
    Regards
    LN
    Edited by: Lakshmi Narayana Chowdary Namala on Sep 22, 2008 12:04 PM

  • SQL - Can u print all the dates between two given dates (Without PL/SQL)

    Hi Friends,
    I want to know if u can print all the dates between two given dates without using pl/sql.
    date1,date2 are given
    write a sql statement to display all the dates lying between those two dates.
    An earlier will be appreciated.
    Thanks in Advance
    Sriram
    null

    Sriram,
    Try this....
    select to_date('01-JAN-00')+to_number(rownum)
    from all_tables
    where rownum < to_date('10-JAN-00')-to_date('01-JAN-00')
    TO_DATE('
    02-JAN-00
    03-JAN-00
    04-JAN-00
    05-JAN-00
    06-JAN-00
    07-JAN-00
    08-JAN-00
    09-JAN-00

  • All Dates between two given Dates

    Hi,
    I need all the dates between two given dates in select-options .
    For example  the range in select-options is 01/01/2007 - 31/03/2007 .
    I need  all the dates between the two given dates .
    How can i do this .Is there any FM for this ?
    Regards,
    Zia

    use this
    CSCP_PARA1_GET_PERIODS
    data:begin of daytab occurs 0.
            include structure scscp_period_str.
    data:end of daytab.
      call function 'CSCP_PARA1_GET_PERIODS'
        exporting
          i_datuv    = r_budat-low
          i_datub    = r_budat-high
          i_timeunit = 'D'
        tables
          et_dates   = daytab.
    here u have to put one more logic.
       loop at daytab where datuv in r_budat.
        endloop.
    So u will get all the dates
    Regards
    prabhu

  • SD pricing extract for given date range

    Hi,
    Is any one knows any FM where you can able to extract pricing for given date range.
    FM Pricing works for one date. I don't want to loop at this
    FM for the given date rage. It takes very long time.
    Thanks for any suggestion.
    Kind Regards
    Nir

    Hi,
    Is any one knows any FM where you can able to extract pricing for given date range.
    FM Pricing works for one date. I don't want to loop at this
    FM for the given date rage. It takes very long time.
    Thanks for any suggestion.
    Kind Regards
    Nir

  • How to calculate a week & Month in given date range (not for sele-options)

    Hi ,
      I have defined 2 date parameters in sel-screen (Plz remember that date variable are not a SELECT-OPTIONS).  Now i want ot display week nos & monts in output.
          Ex: date1: 20080101 & date2: 20080229. then
                    weeks : 1, 2, 3,---9.
                    months: jan-08, feb-08.
    Plz help me with block of code or any FM.
    Regards,

    Hi Srikanth,
            The FM HR_99S_INTERVAL_BETWEEN_DATES   is doesn't existing, but there is a fm HR_MX_INTERVAL_BETWEEN_DATES but it returns no of Years & Days.
           But i found some FM which r returns no of months for given date range. but my requirement is, want to display the month no bw 1 to 12. (ex: dat1=15-03-2008 & dat2= 01-06-2008 then in month fields 03,04,05 & 06. ).
    Plz help me on this.
    -Regards.

  • Get table partition name dynamically for given date range

    Dear All,
    Could you please tell me how to get the partition name dynamicaly for given date range ?
    Thank you.

    SQL> select table_name,
           partition_name,
           to_date (
              trim (
                 '''' from regexp_substr (
                              extractvalue (
                                 dbms_xmlgen.
                                 getxmltype (
                                    'select high_value from all_tab_partitions where table_name='''
                                    || table_name
                                    || ''' and table_owner = '''
                                    || table_owner
                                    || ''' and partition_name = '''
                                    || partition_name
                                    || ''''),
                                 '//text()'),
              'syyyy-mm-dd hh24:mi:ss')
              high_value_in_date_format
      from all_tab_partitions
    where table_name = 'SALES' and table_owner = 'SH'
    TABLE_NAME                     PARTITION_NAME                 HIGH_VALUE_IN_DATE_FORMAT
    SALES                          SALES_1995                     01-JAN-96               
    SALES                          SALES_1996                     01-JAN-97               
    SALES                          SALES_H1_1997                  01-JUL-97               
    SALES                          SALES_H2_1997                  01-JAN-98               
    SALES                          SALES_Q1_1998                  01-APR-98               
    SALES                          SALES_Q2_1998                  01-JUL-98               
    SALES                          SALES_Q3_1998                  01-OKT-98               
    SALES                          SALES_Q4_1998                  01-JAN-99               
    SALES                          SALES_Q1_1999                  01-APR-99               
    SALES                          SALES_Q2_1999                  01-JUL-99               
    SALES                          SALES_Q3_1999                  01-OKT-99               
    SALES                          SALES_Q4_1999                  01-JAN-00               
    SALES                          SALES_Q1_2000                  01-APR-00               
    SALES                          SALES_Q2_2000                  01-JUL-00               
    SALES                          SALES_Q3_2000                  01-OKT-00               
    SALES                          SALES_Q4_2000                  01-JAN-01               
    SALES                          SALES_Q1_2001                  01-APR-01               
    SALES                          SALES_Q2_2001                  01-JUL-01               
    SALES                          SALES_Q3_2001                  01-OKT-01               
    SALES                          SALES_Q4_2001                  01-JAN-02               
    SALES                          SALES_Q1_2002                  01-APR-02               
    SALES                          SALES_Q2_2002                  01-JUL-02               
    SALES                          SALES_Q3_2002                  01-OKT-02               
    SALES                          SALES_Q4_2002                  01-JAN-03               
    SALES                          SALES_Q1_2003                  01-APR-03               
    SALES                          SALES_Q2_2003                  01-JUL-03               
    SALES                          SALES_Q3_2003                  01-OKT-03               
    SALES                          SALES_Q4_2003                  01-JAN-04               
    28 rows selected.

  • Max date data between the input date range.

    Hi
    I need to get the maximum date data's with in the date range.
    Ex: this is sample date but , total records in DB around 2000.
    NAME DATE Product1 Product2
    aaaa 01/05/2011 5 5
    aaaa 03/05/2011 3 3
    bbbb 04/05/2011 6 6
    bbbb 07/05/2011 2 2
    aaaa 06/05/2011 1 1
    case :1) If the user input date is 01/05/2011 to 05/05/2011
    then the result should be
    aaaa 3 3
    bbbb 6 6
    case :2) If the user input date is 01/05/2011 to 10/05/2011
    then the result should be
    aaaa 1 1
    bbbb 2 2
    so my result is purely based on max date between the input date range.
    how to achieve the result

    Dhiva wrote:
    Hi
    I need to get the maximum date data's with in the date range.
    Ex: this is sample date but , total records in DB around 2000.
    NAME DATE Product1 Product2
    aaaa 01/05/2011 5 5
    aaaa 03/05/2011 3 3
    bbbb 04/05/2011 6 6
    bbbb 07/05/2011 2 2
    aaaa 06/05/2011 1 1
    case :1) If the user input date is 01/05/2011 to 05/05/2011Jan 05 to May 05
    or
    May 01 to May 05
    what date is 07/08/09?

  • Name of users of a particular Tcode for a given date range

    Hi experts,
    I am making an alv where inputs will be
    1> T_code(as parameter)
    2> Date Range(as Select options)
    I have to display the following fields:::
    1> User name
    2> Frequency of use the Tcode for the given Date range.
    Please give me the tables where I can get the relation of those fields.
    N.B. I know the transaction AL08 and SM04.But it won't solve my purpose.
    Thanx in advance,
    Sourav

    >
    SOURAV PAUL wrote:
    > Hi experts,
    > I am making an alv where inputs will be
    > 1> T_code(as parameter)
    > 2> Date Range(as Select options)
    by creating the report As per your this requirement you need not to create any Bulk on your SAP.Just use STAD/STAT transaction they are availabe for this purpose.
    and more you may track by security log audit by SM20 get these details.
    i'm worried about tables which sre storing these details.

  • Price change report for  a given date range in inforecords

    hi,
    Can any body suggest how we can get price changes in inforecords for given date range. is there any standard sap tcode or  fuction module.

    Hi,
    If you are referring to the changes in the condition record (for eg. for PR00), then you may go through the foll path:
    Execute VK13 for any condition type - once inside the detail screen, from the menu path, choose Environment -> Changes -> change report. This will take you to a new selection screen where you can define the period you want to see the change record as well as the condition type for which you want to track the changes. Beware, this is a complex report for SAP and it will take definitely longer time to complete. So, it is better to specify short time periods and specific condition types and execute this in background.
    Hope, this helps!
    S. Siva

  • Any FM to get count of each week day for the given date range

    Hi guys,
    Any FM to get count of each week day for the given date range?
    eg: If i give 14/07/2008 to 14/08/2008
    I need to find how many Mondays, tuesdays...sundays in this given date range.
    If not single FM is available, any logic that gives above result is also appreciated.
    Thanks,
    Vinod.

    hi Vinod,
    this is not a full solution, I just give you a basic idea:
    DATA : lv_start TYPE sy-datum VALUE '20080714',
           lv_end   TYPE sy-datum VALUE '20080814'.
    WHILE lv_start LE lv_end.
      CALL FUNCTION 'FTR_DAY_GET_TEXT'
        EXPORTING
          pi_date = lv_start.
    * IMPORTING
    *   PE_DAY_TEXT1       =
    *   PE_DAY_TEXT2       =
    *   PE_DAY             =
    * you have to summarize the output here somehow...
      lv_start = lv_start + 1.
    ENDWHILE.
    hope this helps
    ec

  • To find quarters in given date ranges

    Hi All,
    I need help on this..
    I need to display the quarter dates in a given date ranges.i.e the start date is 06-nov-2008 and the last date is 12-dec-2009.

    Hi,
    Something like:
    WITH  d  AS
        SELECT  TRUNC (TO_DATE (:from_dt_var, 'DD-mon-YYYY'), 'Q') AS from_dt
        ,       TRUNC (TO_DATE (:to_dt_var,   'DD-mon-YYYY'), 'Q')  AS to_dt
        FROM    dual
    SELECT  ADD_MONTHS (from_dt, 3 * (LEVEL - 1))  AS dt
    FROM    d
    CONNECT BY  LEVEL <= 1 + (MONTHS_BETWEEN (to_dt, from_dt) / 3);where :from_ and :to_dt_var are strings like '06-nov-2008'.
    Edited by: Frank Kulash on Nov 6, 2008 9:52 AM
    Added 1 to CONNECT BY condition.

  • Operation wise total required hours for planned order in given date range

    Hello Experts,
    My client wants the report to check the capacity utilization of the work centers for the all planned order in particular date range.
    Is their any standard report which gives the work center wise operation wise total required hours? or which table should I use to make the customize report so that I will get total required capacity & available capacity.
    Thanks in advance for use valuable suggestions.
    Sagar

    Hi Mario,
    Thanks for your reply,
    In CM01 or CM05, we are getting requirement on weekly basis.How to get that report on daily basis? I want to give the input as a date range of the planned order.How to go for that?
    Edited by: SAGAR GOLIWAR 226 on Jul 3, 2011 8:16 AM

Maybe you are looking for