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!

Need to extract highest value from database, based on some field value 1

Status
Not open for further replies.

Cormoran60

Technical User
Nov 16, 2011
2
CA
Hi all,

Using CR 10

First time posting here and I'd like some help to resolve this scenario:

The database I am reading lists multiple orders organized as below (Order #, Version #, Part #).

What I am trying to do is to generate a report that will only show the highest version of all unique orders.

What I get now from the report

Order # Version # Part #
2525 1 Chuck
2525 1 Tire
2525 1 Brake pad
2525 2 Chuck
2525 2 Tire
2525 2 Brake pad
2525 2 Wheel cover
2526 1 Sealed beam
2526 1 Chuck
2526 1 Brake Drum

What I want on the report

Order # Version # Part #
2525 2 Chuck
2525 2 Tire
2525 2 Brake pad
2525 2 Wheel cover
2526 1 Sealed beam
2526 1 Chuck
2526 1 Brake Drum

Thanks

Cormoran60
 
Insert a group on Order# (you can suppress the group header and footer if you like). Then go to report->selection formula->GROUP and enter:

{table.version} = maximum({table.version},{table.order#})

If you need to do calculations across orders, you should use running totals, as the non-group selected records are still IN the report, just not displayed, and thus contribute to the more usual summaries. Running totals will ignore the non-group-selected records.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top