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!

CR9 maximum line numbers 1

Status
Not open for further replies.

VickieT

Technical User
Feb 18, 2004
35
US
Good Morning

I am using Crystal 9 and a SQL DB and doing a report involving employee benefits and deductions. Here is my problem:

There is a field in the table I'm using called "line_no" so that there are multiple records. For an example, std (short term disability) for payroll period "X" ought to only show once on the report. However, since this table has multiple line_no, it shows once with line_no 1 and again with line_no 2 and again with line_no 3 etc. etc. This is basically duplicate info. It varies as to
how many lines each record may have. I just want to show the last line
line_no (which seems to be the one that is most relavent). When I put in a criteria like " line_no = maximum (line_no)" it gives me the error that this must be evaluated later.

Thanks for your help.
 
You're on the right track, but you need to fine tune your solution a little.

What you want to do is group by your field you're using in association with the line number, and enter a variant of your original solution in the Group Selection Criteria editor.

Code:
{Line_No} = Maximum({Line_No},{YourGroupField})

You can achieve the same look by grouping and sticking everything in the group footer, whilst suppressing details, but the first solution is less heavy handed on the database.

All the best,

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top