Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Finding amount of available working hours monthly. Post Reply Post New Topic
Author Message
scottyCR
Newbie
Newbie


Joined: 11 May 2010
Location: United States
Online Status: Offline
Posts: 1
Quote scottyCR Replybullet Topic: Finding amount of available working hours monthly.
    Posted: 11 May 2010 at 5:16am

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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.