Print Page | Close Window

Calculating Business Days

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3009
Printed Date: 02 May 2024 at 2:10pm


Topic: Calculating Business Days
Posted By: fusion
Subject: Calculating Business Days
Date Posted: 23 Apr 2008 at 7:15pm
You can calculate number of weekdays in crystal reports.
In report create a formula and enter the following code.
 
// This formula does not account for holidays
// I am using Shared variable so that I can use in my subreports
 
Shared DateTimeVar d1 := {Orders.Order Date};
Shared DateTimeVar d2 := {Orders.Ship Date};
DateDiff ("d", d1, d2) - 
     DateDiff ("ww", d1, d2, crSaturday) -
     DateDiff ("ww", d1, d2, crSunday)
 



Print Page | Close Window