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

Using "Maximum" for a Record

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hello

I have a 2002 Access Database and I use Crystal 9.0.

I have a patient database and I'm grouping on health card number (unique to patient) and calculating # of visits per Health Card Number. To show current age I'm selecting "maximum" of age because I want the age from the most current visit (the report will show up to 4 years of data) which works great.

However, how do I show the most recent data for elements that might not always be in the database? I want diagnosis and city as it shows on the most recent visit.

Any and all assistance greatly appreciated!
 
You could use group selection (report->selection formula->GROUP):

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

This would display ONLY the record for the most recent visit, but the other records would still be in the underlying data, so you could insert a count on cardno to get the number of visits (assuming a count provides correct results before group selection).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top