can someone help me with a formular to calculate the number of days with Crystal Reports 2008 between two dates without weekends and holidays
date one = 03/24/2010
date two = 03/29/2010
Result should be 4 days as 03/27 and 03/28 will be a weekend.
Plus how to exclude holidays ?
Thank you very much
The DateDiff function can be used to get the number of days skipping weekends.
The Help Text for that function actually has an example, but basically you use the "d" interval type to get the absolute number of days, then the "ww" interval type to get the number of Saturdays, the same for Sundays and subtract those 2 counts from the first.
Holidays are so location specific that you'd have to handle those in some manual way. Perhaps load your holidays into an array, then run through the array and check if each date falls in your date range. I have no example of this or experience doing it!
Edited by: Doug McLauchlan on Mar 26, 2010 9:40 PM - Spelling