Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attendance Records Display 2

Status
Not open for further replies.

tmoor

Programmer
Aug 29, 2002
16
US
Hi all:
Using CR8.5 Developer and MSSQL 2000.
I want to list all of an employee's attendance records for a given date range if he has a certain code.
For example:
Date Code Hours
1/4/03 P 7.5
1/5/03 V 7.5
1/6/03 P 7.5
1/7/03 P 7.5
1/8/03 P 7.5
1/9/03 R 7.5
1/10/03 Z 7.5

Since he has a "Z" code I want to show all his transactions for the above date range, not just the "Z" code date.

Normally I would create a temp file by looping through the employee file and if I came across any attendance records of his that had a "Z" code, I would add his name to the file.
Then I would relate the attendance file to the temp file and report off of it.

Not sure how to do this in crystal.

Thanks
Terry
 
You might try bringing in your table twice.
And linking on the personid.

The criteria on the first table would be looking for
the Z and the date range.


The criteria on the alias table would be for
the date range.

You may have to do some groups and put the detail data on
the group row to keep from printing multiple rows of same data because they could have two Z in the same date range.

Ken Hardwick
Norman,Oklahoma
 
Assuming that Z is the highest code, I'd use a subreport:

In the Main Report, Group by Employee, sorted by Code.

Place a Subreport in the Group footer to display the data, and link by Employee

Suppress the group footer if {table.code} <> &quot;Z&quot;

-k
 
Thanks Ken and -k
It works fine using the subreport in the group footer.
Thanks again
Terry
 
Hi again:
Had to add a division as the first group. So I only want the division to show if there is an employee who has a &quot;Z&quot; code.
Also, putting the codes in a subreport works well and displays all the correct records, however, all employee names show in the group header.
Any way to suppress the division and employees if noone in the division meets the criteria?

Sorry for the update
Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top