Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Business Days 1

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
CA
Is there no easy way to calcualate the number of business days within a date range? It appears that I have to install a dll, then manually path the report to look at a text file which contains the Canadian holidays. This all pertains to verion 7-8.5.

Is there nothing built into version 9 that can do this without so many manual installs and configurations? We also Crystal Enterprise, so this all will then need to be installed on our IIS servers as well. It seems very complex for such common need.
 
Ken Hamady's common formulas might help. See formula #1 in faq767-995.

-LB
 
Go to the Business Ojects Web site to their knowledge base - and search for this file:
cr9_business_days_samples.zip

It contains examples and all you need to accomplish this!

Hope this helps!


paulmarr
 
When inserting a group using a field based on the code below, the report just runs forever. Is there a way to fix this?




//Subtracting Business Days:
WhileReadingRecords;
DateVar Array Holidays;
DateVar Target:={@StartDate}; //Put your field name in here
NumberVar Add:= -3; // Put in the number of days to subtract (a negative 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

 
Anyone? I think it has something to do with the "WHILE" function of the code. When I take it out, then I don't have problems with my report, but I need a way to take weekends out of my calculation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top