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!

Most recent

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
GB
I only want to display the most recent customer order in a report. Not all of them.

Each row in the database can be identified by a order num so how do I bring back the highest order number for each customer
 
1. group by customer
2. sort the details by descending order number
3. suppress or hide details
4. put the fields you wish to show in the group header - the values from the first record in that group will be shown, which will be the record with the highest order number (most recent) for that customer (because of the sort in step 2)

HTH
Icytrue

icytrue@hotmail.com

 
That will print only the most recent, but it will bring back all of them. Keep in mind that any totals will include the hidden records. There is no way for CR to only bring back the most recent. However, another technique is to use a group selection formula:

{field} = Maximum ({field},{groupfield})

This still brings back all of the other records into memory, but you can't see them, and if you use running totals they only include the max value records. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top