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

MAX function at detail level

Status
Not open for further replies.

emallon

Programmer
Jul 6, 2000
31
0
0
US
I have a table containg product detail records. Each product has multiple records of the exact same data except for two fields: prod_cost and cost_key. When a product's cost changes, the cost_key is incremented and a new detail record is placed in this table for that product.

How do you select only the records with the MAX cost_key for each product?
 
Group by product.
Select the cost key and insert a summary field that is the max key for each group.

Then put something like the following in the Group Selection Formula:

{key} = Maximum({key}, {product} ) Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top