Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Help With STD Hours Post Reply Post New Topic
Author Message
Junebug
Newbie
Newbie


Joined: 02 Jun 2009
Online Status: Offline
Posts: 4
Quote Junebug Replybullet Topic: Help With STD Hours
     Posted: 27 Aug 2009 at 4:45pm
I hope I can explain this.  In the table every week a person is active they get a standard hrs record based on a calculation.  Normally this is 40 hours per week but not always.  My problem is with new people who have not worked the entire month.  So in the Crystal report we are three weeks into the month and everyone should have 3 standard hrs. rows or 120 hrs.  Three people started 2 weeks ago and show 80 hrs and I need them to be the same as everyone else.  The standard hours per week vary from week to week but is the same for everyone.  Any ideas how I can use a formula?  I had them add a row everyweek with a dummy employee ID of XXXXXX and this ID will always have the correct Standard hrs. but how do I say if employee 123456 std hrs <> employee XXXXXX std hrs then use XXXXXX std hrs?
Thanks for your help!
Junebug
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Aug 2009 at 7:23am
Since you only have one extra row of data you would have to use a subreport to 'reuse' that row for any employee that did not have rows per week.
If this concept works for your overall needs here is one way to approach it.
Create the main report on all workers that any rows during your time period.create a group per worker record.
make a subreport kinking from main report employee id to the subreport employeeid.
alter your subreport select statement to also include the 'dummy' employee records.
group on the week field.
you will see two records in the group if the employee was present and 1 if they were not.
Create a Running Total.
Field to summarize = hours field
type=SUM
evaluate on change of group
reset to never.
place in report footer.
this should sum the corrected hours.
Change the report format to how you want it to look.
You may need to pass date params from the main to the sub reports as well.
Does this do what you need.
IP IP Logged
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