on 12-10-2009 10:52 PM
Hello:
I need to add the following two functions to the repository, but they both have errors that I don't know how to correct.
#1
// BusinessDays function for calculating the number of business days between a date range
Function (datevar Start, datevar End)
Local NumberVar Weeks;
Local NumberVar Days;
Local Numbervar Hol;
Weeks:= (Truncate (End u2013 dayofWeek(End) + 1 u2013 (Start u2013 dayofWeek(Start) + 1)) /7 ) * 5;
Days := DayOfWeek(End) u2013 DayOfWeek(Start) + 1 +
(if DayOfWeek(Start) = 1 then -1 else 0) +
(if DayOfWeek(End) = 7 then -1 else 0);
// Count the number of holidays in the date range
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 );
// Calculate the number of business days
Weeks + Days u2013 Hol
#2
Function () DateVar Array
// List of the holidays to exclude from business days calc
Holiday := [
Date (2009,01,01), // New Years Day
Date (2009,01,19), // Martin Luther King, Jr.
Date (2009,02,16), // Presidents Day
Date (2009,05,25), // Memorial Day
Date (2009,07,04), // Independence Day
Date (2009,09,07), // Labor Day
Date (2009,10,12), // Columbus Day
Date (2009,11,11), // Veterans' Day
Date (2009,11,26), // Thanksgiving Day
Date (2009,12,25) // Christmas Day
];
Thank you very much!
Deanna
The error is "The Remaining text doesn't appear to be part of the formula. "
Thanks!
Deanna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Deanna,
can you please repost these as separate questions and also include what the error you get is for each post?
thanks,
jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.