Oracle 8i: Business Days Calculation in a Subquery

To Whom It May Concern:
I apologize if this has been posted already, but I didn't find any threads that address my issue:
I need to find the number of business days between 2 dates (excludes weekends) provided by dates from an outer query such as the following:
SELECT
     C.CUSTOMER_ID
     , C.ENTRY_DATE
     , C.COMPLETION_DATE
     , <SOME SUBQUERY HERE THAT CALCULATES THE NUMBER OF BUSINESS DAYS BETWEEN C.COMPLETION_DATE AND C.ENTRY_DATE> AS BUSINESS_DAYS
FROM CUST_TABLE C
Thanks for your time and advice.
Max

you don't need a subquery. it's a very simple formula
Re: query regarding dates
(you may need to change the case to a decode for v8 - I don't remember when it was introduced)

Similar Messages

  • Business Day Calculation

    I would like to add x number of business days to a date extracted from Discoverer Plus. How might one do so?

    Hi,
    I think passing v_nextBusinessDate for checking holiday will solve your problem. Please refer bold lines.
    create or replace function getNextBusinessDay(IN_DATE date)
         return date
         is
              v_nextBusinessDate date;
              v_isAHoliday boolean;
         begin
              v_isAHoliday := false;
              v_nextBusinessDate := IN_DATE;
              loop
                   v_isAHoliday := check_holiday(v_nextBusinessDate);
                   if (v_isAHoliday = false)
                   then
                        exit;
                   else
                        v_nextBusinessDate := v_nextBusinessDate+ 1;
                   end if;
              end loop;
              return v_nextBusinessDate ;
         end;

  • Calculating hours in numerical formats between 2 business days, calculated column

    Hi there,
    I need to calculate how many hours are between 2 days only including business days, outputting in numerical format (ex. 7.3). 
    I've been using this formula to output how many weekdays are between 2 days.
    =IF(AND((WEEKDAY(CompletedTimeStamp,2))<(WEEKDAY(,2)),((WEEKDAY(Created,2))-(WEEKDAY(CompletedTimeStamp,2)))>1),(((DATEDIF(Created,CompletedTimeStamp,"D")+1))-(FLOOR((DATEDIF(Created,CompletedTimeStamp,"D")+1)/7,1)*2)-2),(((DATEDIF(Created,CompletedTimeStamp,"D")+1))-(FLOOR((DATEDIF(Created,CompletedTimeStamp,"D")+1)/7,1)*2)))
    The problem with this is if the 2 dates are on the same day, it outputs "1". I need it to output the amount of hours then / by 24 to give me ".7"  instead.
    Is there anything I can do to convert this current formula to give me hours instead of days?
    Thanks,
    Terence

    The DATEDIF is rounding to the nearest day.
    Try this:
    =IF(AND((WEEKDAY(CompletedTimeStamp,2))<(WEEKDAY(,2)),((WEEKDAY(Created,2))-(WEEKDAY(CompletedTimeStamp,2)))>1),(((CompletedTimeStamp-Created+1))-(FLOOR((CompletedTimeStamp-Created+1)/7,1)*2)-2),(((CompletedTimeStamp-Created+1))-(FLOOR((CompletedTimeStamp-Created+1)/7,1)*2)))
    -1
    Then above will return fractions of days, i.e.  5.5 days. Multiply this by 24 for hours.
    I think there is a extra "+1" in the above example somewhere, so I added a minus 1 to get back the correct value.
    Hi.. Mike.. I am trying to use this calcuation.. its renndering "time being used 3.3".. I need it to calcuate a work day as 8 hrs  so if
    Start Date= 9/12/2014 9:00am
    End Date= 9/16/2014 5:00 pm
    should be 3 (8 hr work days)  any way I can fix this?
    Thanks in advance for your help.
    Mike Smith TechTrainingNotes.blogspot.com

  • Business (Network) day Calculation in BOXI

    Post Author: dusty
    CA Forum: WebIntelligence Reporting
    Hi All,
    I was wondering if anyone has a business day calculation for BOXI.  I am fairly new to BOXI and any assistance will be greatly appreciated.
    Regards,
    Dusty

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    Dusty,
    Your question was posed a while back in another forum, please follow this link:
    http://technicalsupport.businessobjects.com/cs/forums/post/12622.aspx

  • Fucntion to Calculate business days (exclude weekends & holidays) between two days

    Hello,
    I need to be able to calculate business days between two dates excluding weekends and holidays. I do have a date dimension and also flags which denote weekday, holiday. Would really appreciate help in building a udf for the business days calculation.
    Thanks,

    Hi, Please take a look and tweak accordingly. Best of luck.
    --Assuming data dimension table something like the following
    --tblDateDim (DT date primary key,
    flagHoliday bit,
    flagWeekday bit
    CREATE FUNCTION fnBusinessDays (
    @StartDate DATE,
    @EndDate DATE
    RETURNS INT
    AS
    BEGIN
    DECLARE @Days INT ;
    SELECT @Days = count(*)
    FROM tblDateDim --// date dimension
    WHERE
    ( DT BETWEEN @StartDate AND @EndDate) --// dt is date column in the table.
    AND --// also flags which denote weekday, holiday
    flagHoliday = 0 --// flagHoliday= 1--Holiday;= 0 --workingday/businessday
    AND
    flagWeekday = 1 --// FlagWeekday = 1--businessday ; =0 --weekend (Saturday and Sunday)
    RETURN (@Days)
    END
    GO

  • Calculate "Business Days" and account for holidays

    I have played with Date math based on what I have found for documentation, and adding an arbitrary number of days is pretty easy. But what about adding an arbitrary number of business days? I found a web site that talks about "Next business day",
    which could be adapted I am sure, but it only accounts for weekends. I want to calculate the date an arbitrary number of business days from a provided date. So, +3 business days calculated from a Monday should produce the date of the following Thursday,
    and calculated from a Friday should produce the date of the next Wednesday. And calculated from Friday Sept 4, 2015 (Friday before Labor Day) should produce Thursday Sept 10, 2015.
    Given that Windows is very business focused, I wonder if there is some nice hidden .NET functionality to calculate business days based on holidays as well? I know, some offices might give extra days off, four day weekends, etc. But those would be edge case
    enough to be safely ignorable for my purposes. Indeed, even holidays could probably be ignored, but if there is a quick approach I would rather use it. If I would need to code some sort of Exchange calendar scraper or some such, I'll live with just accounting
    for weekends. ;)

    You can pull holiday info from outlook.hol file and do the date math based on it. It won't be 100% reliable though. Not all the holidays listed in calendar are non-business days (not in all countries at least). International support may also present additional
    issues: in some countries it is a common practice to "move" weekend days to fill a single day gap between holidays and weekend (which screws up next business day calc anyway, regardless of holiday info :-). Not to mention all the possible industry-wide
    or company specific policies regarding working days.
    Gleb.

  • Calculation of due date based on Business Days for FICA documents

    Hi All,
    I am working on project where SD - FICA integration is in picture. We post some charges through SD and FICA document gets posted on relevant Contract Account.
    Normally we create Sales Order using transaction VA01 and then we do Billing for this Sales Order through VF01. After billng is done, FICA document automatically gets generated.
    We have following requirement to be fulfilled.
    For the SD bills posted as above, I want to calculate due date of these bills based on Business Days for FICA document generated (SAP Standard calculate due date based on Calander days). We can use factory calander for calculating business days in relevant function module.
    I have checked in the system and it seems that event 1330 ( FM - ISU_DUE_DATE_DETERMINE) is not working in this scenario. Is there any other FM which I can use?
    Can anyone help me on this?
    Regards,
    Pradeep

    Hello Praeva ,
    The event 1330 has a sample FM FKK_SAMPLE_1330. It doesnt even have a Standard Function Module.
    You need to create a Installation-Specific FM and put your code to determine the Due Date based on the logic.
    Rgds
    Ram Kumar.

  • Baseline date calculation excluding non-Business days

    Hi,
    We have a requirement to exclude non-Business days while calculating Baseline date.
    Currently the Baseline Date being populated in the Accounting Document is Document date + 5days(including Holidays).
    For eg
    Current Scenario
    Document Date: 12th Feb 2008
    Baseline date: 17th feb 2008.
    Requirement:
    Document Date: 12th Feb 2008
    Baseline date: 19th feb 2008(Excluding Sat & Sun).
    Request you to share useful info in this regard.
    Thanks
    Binu

    Hi,
    Use user exit RV60FUS5 for these base line date calculations.
    Thanks
    Krishna.

  • Calculating Business Days in a Date Range

    I have two questions:
    1. Does anyone know a better formula for calculating business days in totals?
    I am currently using the formula in https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/701a52c3-6b1e-2b10-21b3-a6e101be1a0f
    I tailored to my needs.  However, there are still a lot of manual maintenance every year. 
    2. I have many reports that need the formula.  It is very consuming to update the formula in each report.  Does anyone know a better way to do it? 
    I use Crystal XI. 11.0.0.895.  We do have a Crystal Enterprise server hosted in another department.

    Not sure if this is any simpler but you could save this as a custom function, that way you will have to modify it once a year for the holidays.
    numbervar days;
    datevar date1 := minimum({?My Parameter});
    datevar date2 := maximum({?My Parameter});
    days := DateDiff ("d", date1, date2) -
    DateDiff ("ww", date1, date2, crSaturday) -
    DateDiff ("ww", date1, date2, crSunday);    // this will give you the number of business days
                                                        // (excluding Saturdays and Sundays) for a given date range.
    // then, for each holiday, you can enter lines like this
    if date(2008,01,01) in {?My Parameter} then days := days - 1;
    // The final tally of DAYS should give you the total business days in a date range.
    totext(days,0);
    where {?My Parameter} is the date range.

  • Calculating Business Days(Start_dt - End_dt)

    Hi Friends,
    Could anyone of you help me to find out the business days(Excluding Saturdays and Sundays) between two dates.
    The difference should be calculated of both the Start_dt and End_dt values truncated. The result should be calculated and stored according to business days, it means weekend days are to be ignored.
    create table sample (id number,start_dt date,end_dt date). The table values are as follows;
    ID ; start_dt ; End_dt
    1 ; 08-02-2012 ; 15-02-2012
    2 ; 30-12-2011 ; 15-02-2012
    My output should be;
    ID ; start_dt ; End_dt ; Expected Business Days (Excluding Weekends)
    1 ; 08-02-2012 ; 15-02-2012 ; 4
    2 ; 30-12-2011 ; 15-02-2012 ; 33
    Please note that, the Start Date and End Date can be any date from any year. Please help me on this.
    Regards,
    Williams.
    Edited by: Williams on Feb 8, 2012 6:28 PM
    Edited by: Williams on Feb 8, 2012 6:29 PM

    Here's my first cut at it.
    SQL> WITH sample AS
      2  (
      3     SELECT 1 AS id, TO_DATE('08-02-2012','DD-MM-YYYY') AS start_dt, TO_DATE('15-02-2012','DD-MM-YYYY') AS end_dt FROM DUAL UNION ALL
      4     SELECT 2 AS id, TO_DATE('30-12-2011','DD-MM-YYYY') AS start_dt, TO_DATE('15-02-2012','DD-MM-YYYY') AS end_dt FROM DUAL
      5  )
      6  /* END SAMPLE DATA */
      7  SELECT id
      8       , start_dt
      9       , end_dt
    10       , COUNT(*)
    11  FROM   sample
    12  JOIN   ( /* Exclude Weekends */
    13           SELECT dt
    14           FROM  ( /* Generate a range that includes all days */
    15                   SELECT min_start_dt + (LEVEL - 1) AS dt
    16                        , TO_CHAR
    17                          ( min_start_dt + (LEVEL - 1)
    18                          , 'fmDAY'
    19                          , 'NLS_DATE_LANGUAGE=AMERICAN'
    20                          ) AS dy
    21                   FROM   ( SELECT MIN(start_dt) AS min_start_dt
    22                                 , MAX(end_dt)   AS max_end_dt
    23                            FROM   sample
    24                          )
    25                   CONNECT BY LEVEL <= max_end_dt - min_start_dt + 1
    26                 )
    27           WHERE dy NOT IN ('SATURDAY','SUNDAY')
    28         ) dys ON dys.dt BETWEEN start_dt AND end_dt
    29  GROUP BY id
    30         , start_dt
    31         , end_dt
    32  /
            ID START_DT            END_DT                COUNT(*)
             2 12/30/2011 00:00:00 02/15/2012 00:00:00         34
             1 02/08/2012 00:00:00 02/15/2012 00:00:00          6
    2 rows selected.I got different results then you though. Can you say why your counts are what they are?

  • Calculation of Business day in OBIEE

    Hi,
    How to calculate the business day in OBIEE by excluding both weekends and public holidays.
    Please guide me

    If you want the "nth business day," here is something I prepared.
    Understanding the Concept in Layman Terms
    The first step to deriving the calculation is looking at a calendar. For our example, we will calculate the 6th business day of each month.
    1) Observation One: When the first day of the month is Saturday, the 6th business day occurs when “today’s date minus the first-day-of-the month equals 9.”
    2) Observation Two: When the first day of the month is Sunday, the 6th business day occurs when the above calculation equals 8.
    3) Observation Three: When the first day of the month is Monday – Friday, the 6th business day occurs when the above calculation equals 7.
    Building the SQL
    Below are the SQL statements that correspond to the above observations:
    4) When the first day of the month is Saturday…
    DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) = 6 AND DAYOFMONTH(CURRENT_DATE)-DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE))) = 9
    5) When the first day of the month is Sunday…
    DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) = 7 AND DAYOFMONTH(CURRENT_DATE)-DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE))) = 8
    6) When the first day of the month is Monday – Friday…
    DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) NOT IN (6,7) AND DAYOFMONTH(CURRENT_DATE)-DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE))) = 7
    Putting the SQL Statements Together
    When any of the above conditions are true (“OR” between each condition), then (THEN) “today” is the 6TH business day; otherwise (ELSE) it is not the 6th business day. Below is the final SQL:
    CASE WHEN
    DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) = 6 AND DAYOFMONTH(CURRENT_DATE)-DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE))) = *9*
    OR
    DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) = 7 AND DAYOFMONTH(CURRENT_DATE)-DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE))) = *8*
    OR
    DAYOFWEEK(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE)) IN (1,2,3,4,5) AND DAYOFMONTH(CURRENT_DATE)-DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(CURRENT_DATE)*-1,CURRENT_DATE))) = *7*
    THEN '6th Business Day' ELSE 'Not 6th Business Day' END
    Modifying the Query for the nth Business Day
    To modify the above SQL for the nth business day, change the numbers in bold to the appropriate values.

  • Subtract business days from date - calculated column

    Hello,
    I had a calculated column on a library that took two dates and found the difference between them in business days, but I am not sure how to subtract business days from a date...for instance I get a start date from a form and I need to
    subtract 10 business days from that date.
    Can anyone help?

    I've always resorted to Javascript/JQuery for that kind of function. I found an old fashioned loop worked the best for me - it supports going forward or backwards. I key it off of a change in a starting date, or sometimes a status change. My actual production
    code takes into account another list where we remove holidays and non-work days.
    newDate = getNextDate(newDate, -3);
    $("input[title='Date Due']").val((newDate.getMonth() + 1) + "/" + newDate.getDate() + "/" + newDate.getFullYear());
    function getNextDate(currentDate, offset) {
    // offset is business days
    var wkend = 0;
    var index = Math.abs(offset); // need positive number for looping
    var neg = true;
    if(offset >= 0) { neg = false; }
    var curDOW = currentDate.getDay();
    var nextDate = new Date(currentDate);
    for(var i=1; i <= index; i++) {
    nextDate.setDate(nextDate.getDate() + (neg ? -1: 1));
    var nextDOW = nextDate.getDay();
    if(nextDOW == 0) {nextDate.setDate(nextDate.getDate() + (neg ? -2: 1));} // Sunday
    if(nextDOW == 6) {nextDate.setDate(nextDate.getDate() + (neg ? -1: 2)); } // Sat
    // alert("offset is " + offset + "start: " + currentDate + ", next date is " + nextDate);
    return nextDate;
    Robin

  • Need Help Calculating Business Days AND omitting Holidays...

    Post Author: dkotenoglou
    CA Forum: Formula
    Thanks to the people here I was able to get a nice formula to help me calculate the amount of business days between two days.//Crystal syntax
    Local DateTimeVar d1 := ;
    Local DateTimeVar d2 := ;
    DateDiff ("d", d1, d2) -
         DateDiff ("ww", d1, d2, crSaturday) - 
         DateDiff ("ww", d1, d2, crSunday) This works great.  I wanted to add the ability to omit US Holidays.  Now this is a straight Crystal Reports install without an SQL backend so I cannot use any formulas there.Is there a parameter? I can use to manually create a table of dates to omit?  The only reason I ask is that our company was closed during the holidays so my day reports are really high. I do not mind typing a long list of days manually (12/24/2007, 12/25/2007, etc) but I need to know how to best integrate that list into the formula.  

    Post Author: V361
    CA Forum: Formula
    If you have CR XI, there is another example as well, in the sample reports,  look at feature examples, custom functions.rpt   this code is from that example.
    Function cdDateAddSkipHolidays (nWorkingDays As Number, startDateTime As DateTime) As DateTime    'the result = startDateTime + nWorkingDays + nHolidays (including weekends)    'the algorithm below also works when nWorkingDays is negative
        Dim totalDays    'give a rough estimate for total days. For each 5 work days there are 7    'days. Also add in an extra 2 weekend days to account for a partial week.    totalDays = Fix(nWorkingDays * 7 / 5 + 1) + 2
        Dim iteratedDiff    iteratedDiff = cdDateDiffSkipHolidays (startDateTime, startDateTime + totalDays)
        If (iteratedDiff >= nWorkingDays) Then        Do While iteratedDiff >= nWorkingDays            totalDays = totalDays - 1            iteratedDiff = cdDateDiffSkipHolidays (startDateTime, startDateTime + totalDays)        Loop        cdDateAddSkipHolidays = startDateTime + totalDays + 1    Else        Do While iteratedDiff < nWorkingDays            totalDays = totalDays + 1            iteratedDiff = cdDateDiffSkipHolidays (startDateTime, startDateTime + totalDays)        Loop         cdDateAddSkipHolidays = startDateTime + totalDays    End If
    End Function

  • Is there a function to derive "business days" only

    Is there either an Oracle SQL built-in function or user-defined function for calculating the difference
    between two dates or between SYSDATE and a date in the database, which uses business days
    only (at least excluding weekends)?
    I'd appreciate any help on this!
    Thanks!
    Kathy Kuehnle
    [ [email protected] ]

    We solved this with the following package:
    create or replace
    package body zentr_date_functions as
      function eastern (p_year in number) return date is
        -- Calculate easter sunday (valid from 1900 to 2099)
        -- based on a Gauss algorithm
        l_a pls_integer;
        l_b pls_integer;
        l_c pls_integer;
        l_d pls_integer;
        l_e pls_integer;
        l_p pls_integer;
        function make_date(p_d in pls_integer, p_m in pls_integer, p_y in pls_integer) return date is
        begin
          return to_date(to_char(p_d, '00')||to_char(p_m, '00')||to_char(p_y, '0000'), 'DDMMYYYY');
        end;
      begin
        if p_year not between 1900 and 2099 then
          return null;
        end if;
        l_a := mod(p_year, 19);
        l_b := mod(p_year, 4);
        l_c := mod(p_year, 7);
        l_d := mod(19 * l_a + 24, 30);
        l_e := mod(2 * l_b + 4 * l_c + 6 * l_d + 5, 7);
        l_p := 22 + l_d + l_e;
        if l_p > 31 then
          if l_p = 56 and l_d = 28 and l_a > 10 then
            return make_date(18, 4, p_year);
          elsif l_p = 57 then
            return make_date(19, 4, p_year);
          else
            return make_date(l_p - 31, 4, p_year);
          end if;
        else
          return make_date(l_p, 3, p_year);
        end if;
      end eastern;
      function is_workday (p_date in date) return number as
        -- Is p_date a working day?
        l_eastern date;
      begin
        if to_char(p_date, 'DY', 'NLS_DATE_LANGUAGE = AMERICAN') in ('SAT', 'SUN') then
          return 0;
        end if;
        if to_char(p_date, 'DDMM') in ('0101', '0105', '0310', '2412', '2512', '2612', '3112') then
          return 0; -- fixed bank holidays in lower saxony, Germany
        end if;
        if to_number(to_char(p_date, 'MM')) not between 3 and 6 then
          return 1;
        end if;
        if to_number(to_char(p_date, 'YYYY')) not between 1900 and 2099 then
          return null;
        end if;
        l_eastern := eastern (to_number(to_char(p_date, 'YYYY')));
        if trunc(p_date) in (l_eastern - 2, l_eastern + 1, l_eastern + 39, l_eastern + 50) then
          return 0; -- eastern depentent bank holidays in lower saxony, Germany
        end if;
        return 1;
      end is_workday;
      -- This is what you are looking for:
      function workdays_between (p_date1 in date, p_date2 in date) return number as
        -- count number of workdays between p_date1 and p_date2 (both p_date1 and p_date2 included).
        l_count pls_integer := 0;
      begin
        for i in 0 .. p_date2 - p_date1 loop
          l_count := l_count + is_workday(p_date1 + i);
        end loop;
        return l_count;
      end workdays_between;
    end;

  • Add number of business days to date field

    Hello, I noticed that there is not much discussion in the forum surrounding u201Cbusiness daysu201D so I hope this post/discussion/solution contributes to the content of this forum.
    I am using the following 3 formulas to try to Add number of business days (based upon a table field) to a specified date:
    1. Variable name = SetVar
    //Set Variable for Add Business Days:
    DateVar Array Holidays;
    DateVar Target:= CDate({TMS_MOVEMENT_EVT.EVT_DATE}); // Put your field name in here
    NumberVar Add:=  {DTCI_DOD_TRANS.TRANS}; // put the number of days here to add (a positive number)
    NumberVar Added := (0);
    2. Variable name = AddBizDays
    //Adding Business Days:
    EvaluateAfter({@SetVar});
    WHILE Added < Add
    Do (target := target +1;
        if dayofweek (target) in 2 to 6 and not (target in holidays)
            then Added:=Added+1
            else Added:=Added);
    Target
    3. Variable name = HOLIDAYS
    //Holiday Array Formula for the report Header:
    BeforeReadingRecords;
    DateVar Array Holidays := [
    Date (2003,12,25),   // you can put in as many lines for holidays as you want. 
    Date (2003,12,31)
    0
    I am successfully getting my data needed to make the necessary calculations and variable assignmentsu2026 I believe that my ISSUE is that I am not sure where to place these formulas into my report so they assign the variables and execute properly when previewing my report. I am curious if that is my issue, and if so, can someone provide me direction on where to put each of these formulas in my report.
    Currently, when I try to preview the report, I get the following Crystal Reports Error:  -u201CA number, currency amount, Boolean, date, time, date-time, or string is expected here.u201D
    Then Crystal automatically opens the AddBizDays formula and highlights the word added, see below RE: u201CWHILE Addedu201D
    For reference, my report has 3 groups, and I am displaying all of my output information (and locating my formulas) in the group footer #3 report section. I have moved them around to other report sections/groups/placements, but to no success.
    Thanks so much.
    Best, Matt

    I worked this out... FYI - for the benefit of all forum users:
    ADDING BUSINESS DAYS TO A CERTAIN DATE (excluding weekends and holidays)
    1. Variable name = AddBizDays
    //Adding Business Days:
    WhileReadingRecords;
    DateVar Array Holidays;
    DateVar Target:= CDate(); // Put your field name in here
    NumberVar Add:=  ; // put the number of days here to add (a positive number)
    NumberVar Added := (0);
    WHILE Added < Add
    Do (target := target +1;
        if dayofweek (target) in 2 to 6 and not (target in holidays)
            then Added:=Added+1
            else Added:=Added);
    Target
    2. Variable name = HOLIDAYS
    //Holiday Array Formula for the report Header:
    BeforeReadingRecords;
    DateVar Array Holidays := [
    Date (2003,12,25), // you can put in as many lines for holidays as you want.
    Date (2003,12,31)
    0
    ...too bad i don't get forum points for sharing this solution.
    Special thanks to KenHamady.com -- for sharing this solution.
    Sincerely,
    Matt

Maybe you are looking for

  • Photosmart C4780 cannot connect to wireless network

    My Photosmart C4780 was working just fine, wirelessly, and now I cannot print unless I connect it to my laptop or desktop via the usb cord.  I am running Mac OSX 10.9 with the Mavricks downloaded on both computers.  I was able to print from my Mac Mi

  • Downloading BLOB to a file using pl/sql toolkit

    Created an Oracle Reports RDF file using the reports builder (9.0.2.x). Uploaded the file into the database in a BLOB column using the following code: >>>> SET VERIFY OFF DECLARE p_bfile BFILE ; p_blob BLOB ; BEGIN p_bfile := BFILENAME('CDR_REPORTS',

  • "Installer" high memory usage

    Hey Guys, I been having problems with my mac. I'm running 10.8.5 on my 2008 Power mac tower and recently I have been having problems with my mac going real slow. I opened Activity Monitor and Noticed something called "Installer" and it was using 90%

  • Sdk 3b Remote Objects not working with java 1.6.29

    So I am not sure if this is java specific or if there is anything in Flex I can do. I am working on a project that communicates with the java back end via the AMF channels / Consumer objects and Remote Objects. Usking SDK 3b In Java 1.6.26 and java 1

  • Variables reset and memory management

        Hi,         I'm writing an application that works on sophisticated     data-structures, and though rely a lot on memory allocations.     As I wanted to do a clean job as much as possible, I divided     the work in different modules, and I'm encou