INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

#### Link To This Forum!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

# Business Objects: Crystal Reports 1 Formulas FAQ

 Forum Search FAQs Links MVPs

## Formula Help

 Calculating the number of Business Days between two dates faq767-4465 Posted: 21 Nov 03 Use the following formula, replacing the items in Bold with your start/end date and the items in Italics with your holidays........WhilePrintingRecords;//Set the values of Start Date and End DateDateVar StartDate := Date(2003,01,01);DateVar EndDate := Date(2003,12,31);//Find out the difference in days and subtract the weekendsNumberVar DaysDiff := DateDiff("d",StartDate,EndDate) - DateDiff("ww",StartDate,EndDate,crsaturday) - DateDiff("ww",StartDate,EndDate,crsunday);//Create an array of Holiday datesLocal DateVar Array Holidays := MakeArray(Date(2003,01,01),Date(2003,01,02),Date(2003,12,25),Date(2003,12,26),Date(2003,07,07));//Loop through the array checking if each holiday is within the datesNumbervar Counter := 0;While UBound(Holidays) <> Counter do(Counter := Counter + 1;if Not(dayofweek(Holidays[Counter]) in [1,7]) andHolidays[Counter] in StartDate to EndDate then DaysDiff := DaysDiff -1;);//Display result to 0 decimal places and no thousand separatortotext(DaysDiff,0,""); Back to Business Objects: Crystal Reports 1 Formulas FAQ Index Back to Business Objects: Crystal Reports 1 Formulas Forum

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!