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

Compare records in a report

Status
Not open for further replies.

mdafni

MIS
Jan 18, 2005
9
0
0
CY
Hi all,

I have a report that is based on two tables that are linked through a common field "policy no" (policy table and agent table). A policy can have more than one agent with different dates. In the report I want to show all the policies with the agents and in the case that a policy has two or more agents to show only the latest one and ignore the others.

Is there a way to do that?
Eg.
Policy Agent Date
100 01 1/1/05
100 02 5/1/05
120 06 5/1/05

In the report I only want to show
Policy Agent Date
100 02 5/1/05
120 06 5/1/05

Thanks in advance for all your help.
mdafni
 
Group by policy. Sort by date within the group. Suppress the detail lines and show the same fields in the group footer.

It helps to give your Crystal version, since newer versions have extra options, and some extra problems.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Madawc forgot to mention that you want to sort by date descending to get the latest agent
 
Or you can group on {table.policy} and then go to report->edit selection formula->GROUP and enter:

{table.date} = maximum({table.date}, {table. policy})

Substitute your field names, of course.

-LB
 
Thank you all for your help. It works fine.

Thanks
mdafni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top