Working days formula and Crystal 7 - is it possible?

Post Author: Tim F
CA Forum: Formula
Hi folks,
Really hope someone can help, I'm struggling with writing a report that needs to show the difference between two dates in working days. I've found the same formula posted here several times but cannot get it to return a logical value in my report. I'm wondering if that might be because I'm using an older version of Crystal? The formula in question is this one:
//Main formulaWhileReadingRecords;Local DateVar Start := ({PPV_COMPLAINTSEH.DTRECD});   Local DateVar End := ({PPV_COMPLAINTSEH.ACTCMPLTD}); Local NumberVar Weeks; Local NumberVar Days; Local Numbervar Hol;DateVar Array Holidays;
Weeks:= (Truncate (End - dayofWeek(End) + 1 - (Start - dayofWeek(Start) + 1)) /7 ) * 5;Days := DayOfWeek(End) - DayOfWeek(Start) + 1 + (if DayOfWeek(Start) = 1 then -1 else 0)  + (if DayOfWeek(End) = 7 then -1 else 0);  
Local NumberVar i;For i := 1 to Count (Holidays)do (if DayOfWeek ( Holidays[i] ) in 2 to 6 and      Holidays[i] in start to end then Hol:=Hol+1 );
Has anyone come across an alternative way of doing this, or have any ideas why this formula is not working in my report? Any advice would be much appreciated,
Regards,
Tim

Post Author: Charliy
CA Forum: Formula
You set up a Running Total.  Drag the filed you want Summed, Select Sum as the operation if that is not the default.
Just below that you weill see Radio Buttons that say For Every Record, On Change of Group, On Change of Field, Use a Formula, etc - click the one that says Use a Formula.  The Blue Bos to its right will turn Red, click on it, this is where you put your formula: NOT(DATEPART('w',{table.date}) IN [6,7])
Save that, then just decide if you want it reset on a Change of Group, or Never (Grand Total).  Give it a name and put it on your report.

Similar Messages

  • Working day formula that excludes weekends and holidays in WEBI

    Hi Guys,
    Can we calculate a working day formula that excludes weekends and holidays in WEBI OR in Universe?
    The universe I am working on is using stored procedures, so there are no joins or modelling done. Although there is a workday stored proc  that I can bring in the universe.
    I am just thinking if there is no modelling or joins done in the universe how will this help me in webi?
    Your suggestions will be very helpful.
    Thanks,
    Jitan

    One more suggestion I need from you  -
    I have a Work_Calendar_VW that has the following columns -
    Calendar_Date - 5/1/2014
    Calendar_Year - 2014
    Calendar_Month - 5
    Calendar_Day - 1
    Work_Day - 1
    Day_Type - WD (Work Day)  For Weekends this will be displayed as WE
    The columns have all dates for current year in SQL Server.
    I am going to pull this into the universe and create 2 derived tables to calculate MTD Day counts.
    Derived Table 1  - Calculate Yest Work Day... this will remove all the weekends and holidays and give me the last working day. This includes couple of case statments to check each day if it's a working day or weekend.
    For Work Day the above code will be 1 and for weekend 0
    Derived Table 2  - This will give me the count of working days in current month using the above view and Derived table 1 Below is the code  -
    SELECT COUNT(*)
    FROM Work_Calendar_VW
    WHERE [Work_Day] = 1 AND
       (Calendar_Date BETWEEN CAST(CONVERT(VARCHAR(25),MONTH(LastWoringkday()),101) + '/01/'
       + CONVERT(VARCHAR(25),YEAR(LastWoringkday()),101) AS DATE)
      AND LastWoringkday()).
    I cannot do joins because this universe has been built using stored proc and would like to implement this in BO universe.
    let me know if this is the right approach.
    Thanks,
    Jitan

  • Calculating Work Day Formulas

    We've recently adopted BOBJ/Webi at my company and I find the software to be rather easy to use in some instances and mind-wreckingly hard in others. One roadblock myself and other users are bumping into is calculating work days. A definition of a work day in this instance would be Monday through Friday. The monkey wrench is that we would also like to subtract out holidays, such as July 4th and Thanksgiving. Then end product would be calculating out what work day the current date is and how many days it is out of so that a simple straight-line extrapolation can be made (Metric/Current Work Day)*Total Work Days. Also, what we invoice/ship is not accounted for until the following day... for example, today (2.22.10) would be the 15th workday in February out of 20 total work days.
    Appreciate any and all help/assistance/counsel I can get on this.
    Ryan

    Hi Ryan,
    If I have understood your question then I think following solution may help you.
    Do you have your Universe created on the top of BW query or is it some other Database?
    If it is some other database then create couple of Filter at Universe level: Such as Holidays so that you can use this one to subtract holidays:
    For Example:
    ucase(Calendar_year_lookup.Holiday_Flag)
    ucase(Calendar_year_lookup.Holiday_Flag) = 'Y'
    Then you create another Dimension for Work days that would be between Monday to Friday.
    Once they are created in Universe you export Universe.
    Now create a formula where you would use month minus custom dimension workdays and minus holidays to get actual work days which would be from Monday to Friday and son on.
    Basically we can achieve this by using filters and formulas.
    Wish you good luck.
    Bashir Awan

  • New to SAP BW/BI and Crystal Report

    Hi Experts,
    I have worked on Dataware house side but I am new to SAP BI ( had a training of 60 hours). I have got an offer for a job where I will be working on BI and Crystal reports as a SAP BW analyst.
    I am looking for some help regarding BI + Crystal Report combo. A link to a guide, webcast, your experience or any other info.
    I appreciate your time, spending to read my thread. Any of your help/post would help me and others who are inspired by SAP solutions.
    This is a wonderful forum, I am reading past threads and floating on ocean of information. Thanks from bottom of my heart
    Have a wonderful day ahead.
    Regards,
    Nit

    Hi,
    First you can Download the Crystal Report trial version and play around with the sample database in order to get use to interface and features.
    http://www.businessobjects.com/product/catalog/crystalreports/
    And may be read the user guide and Admin guide they are really useful.
    1-http://help.sap.com
    2-Business Objects tab
    Regards,
    Adil

  • Factory Calendar to prevent delivery on a non-working day

    Hi Guys,
    You may have already come across this problem and hence requesting your inputs on the same.
    I'm able to create a delivery for a sales order on a week-end even though they happen to be 'non-working days' in my Factory Calendar. I have gone through the search forum and the 2 things that most of them said was to attach the Factory Calendar (having Sat and Sun as non-working days) to the Plant and Shipping Point, which I have already done, inspite of which I'm able to create a delivery for a schedule line date which falls on a non-working day.
    My business scenario requires that even though a Sales Order may be created on a non-working day, the delivery should only be possible on the next working day, even if stock is available on those non-working days.
    Your thoughts/suggestions/ideas would be useful.
    Regards,
    Shripad

    Hi Shripad,
    In Customer Master, General Data , We have  Unloading Points  Option. There we can opt for the delivery to the cutomer.
    Then we can stop delivery for that day.
    Award points if it adds information.
    Thanks
    Mohan

  • DB connect problem,Disp+Work.exe dies and the work processes die on startup

    Dear Experts,
    I am getting the error on SAP startup,Disp+Work.exe dies and the work processes die on startup.
    I found below error in my DEV_W0 trace as below
    *failed to establish conn to np:(local).*
    *C  Retrying without protocol specifier: (local)*
    *C  Provider SQLNCLI could not be initialized. See note #734034 for more information.*
    *C  Using provider SQLOLEDB instead.*
    *C  ExecuteAndFlush return code: 0x80040e14 Stmt: [if user_name() != 'pec' setuser 'pec']*
    *C  sloledb.cpp [ExecuteAndFlush,line 5989]: Error/Message: (err 4604, sev 0), There is no such user or group 'pec'.*
    *C  Procname: [ExecuteAndFlush - no proc]*
    But i could see the user 'pec' is availble in my database users list  with db_owner , public permissions also been assigned to it.
    However When trying to delete a user on SQL server 2000, we recieve the message "You cannot drop the selected login ID because that login ID owns objects in one or more databases.".
    Please refer the below work process trace and please suggest the possible solution..
    trc file: "dev_w0", trc level: 1, release: "640"
    ACTIVE TRACE LEVEL           1
    ACTIVE TRACE COMPONENTS      all, M

    B Sat Feb 14 15:10:21 2009
    B  create_con (con_name=R/3)
    B  Loading DB library 'E:\usr\sap\PEC\SYS\exe\run\dbmssslib.dll' ...
    B  Library 'E:\usr\sap\PEC\SYS\exe\run\dbmssslib.dll' loaded
    B  Version of 'E:\usr\sap\PEC\SYS\exe\run\dbmssslib.dll' is "640.00", patchlevel (0.195)
    B  New connection 0 created
    M sysno      00
    M sid        PEC
    M systemid   560 (PC with Windows NT)
    M relno      6400
    M patchlevel 0
    M patchno    196
    M intno      20020600
    M make:      multithreaded, Unicode
    M pid        3844
    M
    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc 0 3844) [dpxxdisp.c   1162]
    I  MtxInit: -2 0 0
    M  DpSysAdmExtCreate: ABAP is active
    M  DpShMCreate: sizeof(wp_adm)          21120     (1320)
    M  DpShMCreate: sizeof(tm_adm)          29558776     (14772)
    M  DpShMCreate: sizeof(wp_ca_adm)          24000     (80)
    M  DpShMCreate: sizeof(appc_ca_adm)     8000     (80)
    M  DpShMCreate: sizeof(comm_adm)          1160000     (580)
    M  DpShMCreate: sizeof(vmc_adm)          0     (424)
    M  DpShMCreate: sizeof(wall_adm)          (384056/329560/64/184)
    M  DpShMCreate: SHM_DP_ADM_KEY          (addr: 07800040, size: 31492672)
    M  DpShMCreate: allocated sys_adm at 07800040
    M  DpShMCreate: allocated wp_adm at 07801B88
    M  DpShMCreate: allocated tm_adm_list at 07806E08
    M  DpShMCreate: allocated tm_adm at 07806E30
    M  DpShMCreate: allocated wp_ca_adm at 09437628
    M  DpShMCreate: allocated appc_ca_adm at 0943D3E8
    M  DpShMCreate: allocated comm_adm_list at 0943F328
    M  DpShMCreate: allocated comm_adm at 0943F340
    M  DpShMCreate: allocated vmc_adm_list at 0955A680
    M  DpShMCreate: system runs without vmc_adm
    M  DpShMCreate: allocated ca_info at 0955A6A8
    M  DpShMCreate: allocated wall_adm at 0955A6B0
    X  EmInit: MmSetImplementation( 2 ).
    X  <ES> client 0 initializing ....
    X  Using implementation flat
    M  <EsNT> Memory Reset disabled as NT default
    X  ES initialized.

    M Sat Feb 14 15:10:22 2009
    M  calling db_connect ...
    C  Thread ID:3868
    C  Thank You for using the SLOLEDB-interface
    C  Using dynamic link library 'E:\usr\sap\PEC\SYS\exe\run\dbmssslib.dll'
    C  dbmssslib.dll patch info
    C    patchlevel   0
    C    patchno      195
    C    patchcomment DBCON: database names must not start with digits (1078650)
    C  np:(local) connection used on CAMBSVR15
    C  CopyLocalParameters: dbuser is 'pec'

    C Sat Feb 14 15:10:23 2009
    C  Provider SQLNCLI could not be initialized. See note #734034 for more information.
    C  Using provider SQLOLEDB instead.
    C  OpenOledbConnection: MARS property was not set.

    C Sat Feb 14 15:10:26 2009
    C  ExecuteAndFlush return code: 0x80040e14 Stmt: [if user_name() != 'pec' setuser 'pec']
    C  sloledb.cpp [ExecuteAndFlush,line 5989]: Error/Message: (err 4604, sev 0), There is no such user or group 'pec'.
    C  Procname: [ExecuteAndFlush - no proc]
    C  setuser 'pec' failed -- connect terminated
    C  Provider SQLNCLI could not be initialized. See note #734034 for more information.
    C  Using provider SQLOLEDB instead.
    C  ExecuteAndFlush return code: 0x80040e14 Stmt: [if user_name() != 'pec' setuser 'pec']
    C  sloledb.cpp [ExecuteAndFlush,line 5989]: Error/Message: (err 4604, sev 0), There is no such user or group 'pec'.
    C  Procname: [ExecuteAndFlush - no proc]
    C  setuser 'pec' failed -- connect terminated
    C  Provider SQLNCLI could not be initialized. See note #734034 for more information.
    C  Using provider SQLOLEDB instead.
    C  ExecuteAndFlush return code: 0x80040e14 Stmt: [if user_name() != 'pec' setuser 'pec']
    C  sloledb.cpp [ExecuteAndFlush,line 5989]: Error/Message: (err 4604, sev 0), There is no such user or group 'pec'.
    C  Procname: [ExecuteAndFlush - no proc]
    C  setuser 'pec' failed -- connect terminated
    C  failed to establish conn to np:(local).
    C  Retrying without protocol specifier: (local)
    C  Provider SQLNCLI could not be initialized. See note #734034 for more information.
    C  Using provider SQLOLEDB instead.
    C  ExecuteAndFlush return code: 0x80040e14 Stmt: [if user_name() != 'pec' setuser 'pec']
    C  sloledb.cpp [ExecuteAndFlush,line 5989]: Error/Message: (err 4604, sev 0), There is no such user or group 'pec'.
    C  Procname: [ExecuteAndFlush - no proc]
    C  setuser 'pec' failed -- connect terminated
    C  Provider SQLNCLI could not be initialized. See note #734034 for more information.
    C  Using provider SQLOLEDB instead.
    C  ExecuteAndFlush return code: 0x80040e14 Stmt: [if user_name() != 'pec' setuser 'pec']
    C  sloledb.cpp [ExecuteAndFlush,line 5989]: Error/Message: (err 4604, sev 0), There is no such user or group 'pec'.
    C  Procname: [ExecuteAndFlush - no proc]
    C  setuser 'pec' failed -- connect terminated
    C  Provider SQLNCLI could not be initialized. See note #734034 for more information.
    C  Using provider SQLOLEDB instead.
    C  ExecuteAndFlush return code: 0x80040e14 Stmt: [if user_name() != 'pec' setuser 'pec']
    C  sloledb.cpp [ExecuteAndFlush,line 5989]: Error/Message: (err 4604, sev 0), There is no such user or group 'pec'.
    C  Procname: [ExecuteAndFlush - no proc]
    C  setuser 'pec' failed -- connect terminated
    C  failed to establish conn. 0
    B  ***LOG BY2=> sql error 0      performing CON [dbsh#3 @ 1204] [dbsh    1204 ]
    B  ***LOG BY0=> <message text not available> [dbsh#3 @ 1204] [dbsh    1204 ]
    B  ***LOG BY2=> sql error 0      performing CON [dblink#3 @ 428] [dblink  0428 ]
    B  ***LOG BY0=> <message text not available> [dblink#3 @ 428] [dblink  0428 ]
    M  ***LOG R19=> tskh_init, db_connect ( DB-Connect 000256) [thxxhead.c   1280]
    M  in_ThErrHandle: 1
    M  *** ERROR => tskh_init: db_connect (step 1, th_errno 13, action 3, level 1) [thxxhead.c   9621]

    M  Info for wp 0

    M    stat = 4
    M    reqtype = 1
    M    act_reqtype = -1
    M    rq_info = 0
    M    tid = -1
    M    mode = 255
    M    len = -1
    M    rq_id = 65535
    M    rq_source = 255
    M    last_tid = 0
    M    last_mode = 0
    M    int_checked_resource(RFC) = 0
    M    ext_checked_resource(RFC) = 0
    M    int_checked_resource(HTTP) = 0
    M    ext_checked_resource(HTTP) = 0
    M    report = >                                        <
    M    action = 0
    M    tab_name = >                              <

    M  *****************************************************************************
    M  *
    M  *  LOCATION    SAP-Server cambsvr15_PEC_00 on host cambsvr15 (wp 0)
    M  *  ERROR       tskh_init: db_connect
    M  *
    M  *  TIME        Sat Feb 14 15:10:26 2009
    M  *  RELEASE     640
    M  *  COMPONENT   Taskhandler
    M  *  VERSION     1
    M  *  RC          13
    M  *  MODULE      thxxhead.c
    M  *  LINE        9806
    M  *  COUNTER     1
    M  *
    M  *****************************************************************************

    M  PfStatDisconnect: disconnect statistics
    M  Entering TH_CALLHOOKS
    M  ThCallHooks: call hook >ThrSaveSPAFields< for event BEFORE_DUMP
    M  *** ERROR => ThrSaveSPAFields: no valid thr_wpadm [thxxrun1.c   730]
    M  *** ERROR => ThCallHooks: event handler ThrSaveSPAFields for event BEFORE_DUMP failed [thxxtool3.c  254]
    M  Entering ThSetStatError
    M  Entering ThReadDetachMode
    M  call ThrShutDown (1)...
    M  ***LOG Q02=> wp_halt, WPStop (Workproc 0 3844) [dpnttool.c   357]
    I would greatly appriciate your quick response, Since it is a production issue.
    Many Thanks,
    Vinod

    Hi Rohit and Subhadip,
    My problem was solved, thanks for your effort.
    reason is that, user 'pec' not been associated with login user for the SQL server.
    subha : when i execute the first command which you suggested, but couldn't find any user's list.
    so i didn't  tried with the second command. just to give a final try i have executed the script like below and its worked out.
    USE PEC
    GO
    EXEC sp_change_users_login 'update_one','pec','pec'
    GO
    Now i see that all work process are starting,,,thank you so much rohit and subhadip
    I could have try this first ,when you guys suggested since i couldn't find any output with the first command i didn't proceed with second one.
    Since deleting and creating method doesn't seems to be a good, i have just to give a try executed the second command and its worked.
    Thanks for your time and patience
    Many Thanks,
    Vinod

  • Calculate x working days before date

    Dear experts,
    I am trying to find a date that is x working days before another.
    Is that a function module about this?
    Thank you in advance,
    Roxani

    Hi Roxani,
    You can use FM END_TIME_DETERMINE.
    There:
    - Insert in duration the number of days that you want to subtract with the minus sign (ex: -1 for previous working day)
    - Also, insert your factory calendar that you want to be the source of your working days.
    - And, of course, the desired starting date.
    Hope that helps!
    Kind regards,
    Garcia

  • HR-TM: Two Holiday Calendars That Have Different Non-working Days?

    Dear All,
    Please help me on the predicament below:
    I need to create two holiday calendars.
    Holiday Calendar 1 will have Saturday and Sunday as non-working days.
    Holiday Calendar 2 will have Friday and Saturday as non-working days.
    And both holiday calendars are used in the same country.
    Then, there is one holiday which is assigned to both holiday calendars such as New Year Day.
    How can I configure so that
    1) if New Year Day falls on the first non-working day of each week of each holiday calendar, the holiday will be moved to the previous day?
    2) if New Year Day falls on the second non-working day of each week of each holiday calendar, the holiday will be moved to the following day?
    Should I create two lines of data for New Year Day so that each of them assigned to different holiday calendar?
    Or I can just use one New Year Day in both holiday calendars?
    Thanks.

    I've got my answer.
    First calendar, i use fixed date and floating date for the public holiday based on the real situation.
    Second calendar, i use floating date for all the public holiday, then set the date every year once.

  • How do I get my subscription activation to "stick"?  30 days in and it is not working now???

    I signed up for the Creative Cloud on November 25th.  Everything went fine, I installed various software without any (known) issues and things worked...  On, or around, Saturday, Dec. 22, I got a "subscription activation" notification and I went through the process of logging into the account and it came back and said "subscription activated".  Photoshop worked, no problem.  Ten minutes later, with a third or fourth time of bringing up Photoshop (directily or via Bridge), it asked to go through the "subscription activation" again...  and again, and again.  Every other time, every third, fourth, fifth time bringing up Photoshop it would ask again.  Sometimes everything would work ok, other times Photoshop would just drop out and close.
    Same thing happened on Sunday... Each time it would tell me that the subscription was activated.  Each time, it came back, sometime in the next several uses.
    This has continued to ocurr ever since.
    This is NOT how I understood things were supposed to work.  I was under the impression that all I only had to have internet access ONCE, around the 30 day period for re-activation.  Not that it would require multiple / continual activations after 30 days.... 
    Not only is this an embarassment, when a client is with me, it is a royal pain in the neck and extremely time consuming (costly).
    "Chat" was of no help.  Nothing they can do, was what I was told, "it is a technical problem" and I have to call in...
    Calling in...  It didn't happen the one or two times they tried, it happened two or three times AFTER they were long gone.
    Now it has been over 30 days and "Chat" tells me there is nothing they can do about the problem and nothing they can do about cancelling the subscription, or even exchanging the remaining amount on my subscription towards an upgrade for a stand-a-lone version of Photoshop.  Quote:  I had 30 days to decide I didn't want to use the service.  Per the agreement, I can't cancel without paying a penalty.
    The service is NOT working as expected and the problem was not noticed until the 30 day mark, when activation was requested / required!!!  How could I have possibly known there was a problem until it came up??
    Very frustraighted...  and worse, I have no idea where to turn, who to ask...?????
    Account is active and I just received (via email) my recept for the payment having been received at the first 30 day date (today).

    Hi Jbierrie,
    There is an issue with Photoshop specifically related to recent updates in which causes the licensing to revert to trial after a certain number of launches (typically 2-3).
    The current workarounds are to either:
    - Sign in with your Adobe ID again every few launches
    - Uninstall Photoshop CS6 and then reinstall it but don't install any of the updates
    The issue with the updates is planned to be fixed in the coming weeks. Sorry for the inconvenience.
    -Dave

  • Is it possible to create a variable in bex with the last work day?

    Hi Gurus
    Is it possible to create a variable in bex with the last work day?
    Actually end-user every day open queries,
        - Put in selection date day - 1 or
        - put last Friday if the day is Monday or
        - put last Thursday if the day is Monday and Friday is holiday (in a calendar for example 25 the December).
    Please do the needful. It is urgent
    Thanks in advance
    Raj

    Try this logic in a customer exit:
    DATA:  l_s_range TYPE rsr_s_rangesid.
    DATA:  X_PERIOD LIKE T009B-POPER,
               X_YEAR   LIKE T009B-BDATJ.
      CASE I_VNAM.
      WHEN 'ZPREVWORKDAY'.
        DATA: l_DayOfWeek(1) TYPE C,
              l_act_date     TYPE d,
              l_prev_date    TYPE d.
        l_act_date = sy-datum.
        CALL FUNCTION  'DATE_COMPUTE_DAY'
             EXPORTING DATE = l_act_date
             IMPORTING DAY  = l_DayOfWeek.
        CASE l_DayOfWeek.
          WHEN '1'.
            l_prev_date = l_act_date - 3.
          WHEN '2'.
            l_prev_date = l_act_date - 1.
          WHEN '3'.
            l_prev_date = l_act_date - 1.
          WHEN '4'.
            l_prev_date = l_act_date - 1.
          WHEN '5'.
            l_prev_date = l_act_date - 1.
          WHEN '6'.
            l_prev_date = l_act_date - 1.
          WHEN '7'.
            l_prev_date = l_act_date - 2.
        ENDCASE.
        l_s_range-low  = l_prev_date.
        APPEND l_s_range TO e_t_range.
    ENDCASE.
    Edited by: Tyler Blouse on Feb 13, 2008 8:28 PM

  • Working days between two date fields and Changing Factory Calendar

    Hi,
    I have to calculate working days between two date fields excluding the weekends and public holidays for Switzerland.
    I have written the routine using factory calender and its working fine except for two problems now:
    1. If any one of the date field is empty then teh rsult should be zero.
    2. And the below code is working from 1996 but my cleints wants it to work for years before 1996 as well.
    I also tried to change the Start date in SCAL for factory calendar but it says enter values between 1995 to 2020.
    I am new to ABAP. Please help me how i can achieve these for below code.
    DATA: IT_HOLIDAYS type TABLE OF ISCAL_DAY,
          IS_HOLIDAYS TYPE ISCAL_DAY.
    DATA: T_DATE TYPE SY-DATUM,
          P_DATE TYPE SY-DATUM.
    DATA : X_DATE(4) TYPE C.
    DATA: CNT TYPE I.
    REFRESH : IT_HOLIDAYS.
    CLEAR : IT_HOLIDAYS.
    T_DATE = SOURCE_FIELDS-/BIC/ZCCCHP812.
    P_DATE = SOURCE_FIELDS-/BIC/ZCCCHP810.
    CALL FUNCTION 'HOLIDAY_GET'
    EXPORTING
    HOLIDAY_CALENDAR = 'CH'
    FACTORY_CALENDAR = 'CH'
    DATE_FROM = P_DATE
    DATE_TO   = T_DATE
    TABLES
    HOLIDAYS = IT_HOLIDAYS
    EXCEPTIONS
    FACTORY_CALENDAR_NOT_FOUND = 1
    HOLIDAY_CALENDAR_NOT_FOUND = 2
    DATE_HAS_INVALID_FORMAT = 3
    DATE_INCONSISTENCY = 4
    OTHERS = 5.
    DESCRIBE TABLE IT_HOLIDAYS LINES CNT.
    X_DATE = T_DATE - P_DATE - CNT.
    RESULT = X_DATE.
    Please help
    Regards
    Zabina
    Edited by: Syed786 on Nov 2, 2011 9:15 AM

    Hi Zabina,
    Try this function module  'DURATION_DETERMINE'.
    Give the factory calendar and unit as DAY
    With regards,
    Rajesh

  • How can I display assignment-level Work in hours and days in the same view?

    I have a view based on Task Usage and I shows the Work figure for each resource assigned to a task.  My Options settings are to display Work in hours.  Want I'd like to do is have a custom field to calculate the equivalent number of days for each
    assignment-level work value.  Our hours per day are 7.4 so the calculated field should be [Work]/7.4.  eg.
    Task Name >  Work         >  Work-days (Calc'd Field)
    Task 1
        Fred        >  7.4 hrs     >  1 days
     I tried creating a Resource custom field to do this but what displays is the value of the Task-level Work and this same value is repeated on every assignment row.  MSP is not using the Work value of the assignment. 
    Is there a way to acheive this view?
    Thanks
    John

    You're welcome John.
    You could have a calculated task custom field which could divid the work in hours by 7.4 hours, but even like this you couldn't add it to a usage view and it would be only at task level, not assignment. Maybe a VBA macro could switch automatically the option
    but I'm not sure.
    If a reply above helped you, please mark it as an answer so other users with a similar concern can refer to it.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • I want to accumulate rain for the day, month and year; What formula can I use?

    I want to accumulate rain for the day, month and year; What formula or expression can I use.
    I am using a Rain Wise product that converts pulses to an analog value.  The Rain Wise device can be
    set to measure up to 1", 5", or 10".  I will be setting the unit to 10 inches in increments of 0.01 inches.
    What I would like to do is everytime the signal increments I would like to count it as 0.01 then after reaching
    a period of time whether it be a day or a month reset back to zero.
    Need some advise on this problem.
    Solved!
    Go to Solution.

    Hello Ryan,
    Lookout gets a Modbus over Ethernet signal which originates as a 4-20mA input to a Moxa Ethernet I/O Module (E1240) in the field.  In Lookout I created a ModbusEthernet Driver and a tag which scales 0 - 65534 RAW to 0-10 Eng.  [0 - 10 is inches of rain]  Also, another piece of information is that after the rain gauge maxes out at 10 inches it will zero out and start over.
    I though the accumulator was time based and took a sample over a specific time period, for instance, one sample every 30 seconds then accumulate.  If this is so then if I have 5 inches of rain and then it stopped raining, then 30 seconds latter it would sample, it would see 5 inches and add that to be 10 inches when actually it had only rained 5 inches. 
    I really need some help with this process,
    David Lopez
    City of Corpus Christi

  • Need working days for a particular month and year

    Hi,
    I need the number of working days for a particular month and year.Saturdays and Sundays are holidays.
    Regards,
    Vignesh

    Try this:
    SQL> var yr NUMBER;
    SQL> exec :yr := 2010;
    PL/SQL procedure successfully completed.
    SQL> with t as (select :yr yr from dual)
      2  SELECT TO_CHAR(dat,'MON-RR'),COUNT(*) FROM
      3  (select TO_DATE('01-JAN-'||yr) + lv dat FROM
      4  (select level - 1 lv,yr from t
      5  connect by level <= TO_DATE('31-DEC-'||yr) - TO_DATE('01-JAN-'||yr) + 1))
      6  WHERE TO_CHAR(Dat,'DY') NOT IN ('SAT','SUN')
      7  GROUP BY TO_CHAR(dat,'MON-RR');
    TO_CHAR(DAT,   COUNT(*)
    APR-10               22
    AUG-10               22
    DEC-10               23
    FEB-10               20
    JAN-10               21
    JUL-10               22
    JUN-10               22
    MAR-10               23
    MAY-10               21
    NOV-10               22
    OCT-10               21
    TO_CHAR(DAT,   COUNT(*)
    SEP-10               22
    12 rows selected.
    SQL> Edited by: AP on Jul 27, 2010 7:54 AM

  • Adobe Acrobat Pro XI 11.0.06 when I reduce file size or try to optimize, I get this error: The document could not be saved. A number is out of range. I do the exact same thing every month and it works. I did it a few days ago and it worked. I receated the

    Adobe Acrobat Pro XI 11.0.06 when I reduce file size or try to optimize, I get this error: The document could not be saved. A number is out of range. I do the exact same thing every month and it works. I did it a few days ago and it worked. I receated the pdf, I renamed it. tried to do it before I imported more pages. no go. the 16 mg pdf will normally reduce to 5 or 6

    Hi,
    Are you facing the issue with any pdf file?
    Please try updating Acrobat to 11.0.7 and check.
    You might also want to repair Acrobat and see.
    Regards,
    Rave

Maybe you are looking for