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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flag if field is repeated

Status
Not open for further replies.

VergeResources

Programmer
Feb 6, 2002
40
US
I have a report that lists employees grouped by their section. Some employees report to more than one section. When this happens, I want to put an '*' next to their name. This will indicate that the employee exists elsewhere on the report. I'm having trouble doing this since I need to search across groups for a repeated employee name.

Any suggestions?
 
A stored procedure or View would be best.

Another option is a subreport.

The subreport can count the number of occurences of the employee, and assign it to a shared variable, you can place an asterisk based on the shared variable being greater than 1.

Link the main report to the sub based on employee.

In the subreport footer place something like the following:

whileprintingrecords;
shared numbervar SectionCount;
SectionCount := count({MyTable.employee})

Back in the main report AFTER the subreport place something like:

whileprintingrecords;
shared numbervar SectionCount;
SectionCount

This should get you close.

-k kai@informeddatadecisions.com
 
Thanks for your quick response. A subreport would work, but with the amount of data I have, it is probably going to be too slow for my users.

A stored procedure is probably my best bet, but that means I'm going to have to convince my DBA's that it is necessary...

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top