I'm working with a report that my organization uses to calculate productivity metrics and am having some problems with breaking the working hours down by month. I use two formulas to find the total number of working hours.
First I use the following formula to find the total of working days:
Local DateVar d1 := {?Start Date};
Local DateVar d2 := {?End Date};
if (
{@First Day of Month}=(7))
then
(DateDiff("d", d1, d2))-
(DateDiff("ww", d1, d2, crsaturday) +
DateDiff("ww", d1, d2, crsunday))
else
if (
{@First Day of Month}=(1))
then
(DateDiff("d", d1, d2))-
(DateDiff("ww", d1, d2, crsaturday) +
DateDiff("ww", d1, d2, crsunday))
else
(DateDiff("d", d1, d2)+1)-
(DateDiff("ww", d1, d2, crsaturday) +
DateDiff("ww", d1, d2, crsunday))
Then I take that formula and multiply by 7 to calculate the total number of working hours available between the dates entered.
The problem that I'm running into is that I'm being asked now to break the report down monthly and I can't figure out how to calculate the number of working days monthly. If I try to place the above formula in a group field based on month, it still calculates the total for the entire time frame rather than just for the month that applies. Any help you can offer would be much appreciated. Thanks.
Edited by scottyCR - 11 May 2010 at 7:25am