Shared variable returns only last record

I have a Crystal Report with a Main report and a Sub Report.  The Main report contains data on employees, primarily wage information.  The Subreport contains Pay Grade Schedule, Pay Step, Pay Seq.  Pay Step 1 is the Minimum Amount, Pay Step 2 is the Midpoint, Pay Step 3 is the Maximum.  The purpose of the report is to identify those employees who are within the ranges as well as those outside the ranges.  The link between the Main report and the Subreport is the Pay Grade which is the only common field between the referenced tables.  To compare the Employee Pay Rate a shared currency varialble was created in the Main report to pass to the Subreport for comparision.  Only the last record in the row of data is being passed from the Main Report to the Subreport.  I need to be able to pass all the rows of employees so that calculations can be made to do the comparisons of those outside the Pay Step ranges.  How do I return all records of the employees in the Subreport?
garyjgsAsked:
Who is Participating?
 
garyjgsAuthor Commented:
The paygrade schedule has Min, Mid, Max.  For example, Pay Grade 24 has a Min $10, Mid $15, Max $20.   The employee is assigned to a Pay Grade which is the only common field between the Pay Grade table and the Employee table.  The employee is given a Pay Rate which can be $25 per hour.  There is no validation between the Pay Grade and Employee tables.  It needs to be determined if the employee is either below the Min or above the Max in the Pay Grade.
0
 
peter57rCommented:
Doesn't sound like a practically do-able proposition to me.

Why can't you add both tables to the main report and link them on paygrade.  Then you can sort or group b pay grade and show whether each eamployee is inside or outside the pay limits.

0
 
garyjgsAuthor Commented:
What I figured out that if I placed the Pay Rate from the Main report to the Subreport and placed the Subreport in the Main report's details section, I was able to return each employee's salary in the subreport to compare against the grades.  I tried earlier linking the Pay Grade table as a join but received duplicate rows of the same employee without using a subreport.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
peter57rCommented:
....received duplicate rows of the same employee ...

That suggests that there are multiple records per pay grade and/or multiple records per employee in their respective tables. Do you know whether that is the case.
0
 
garyjgsAuthor Commented:
There are multiple records per pay grade.
0
 
peter57rCommented:
So for employee1 on paygrade x, where there are multiple records for paygrade x, how do you decide which paygrade x record to use to assess employee1?
0
 
mlmccCommented:
The question has been deleted.  No comment so I assume the asker deleted it.

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.