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!

Total only last record in group

Status
Not open for further replies.

wesGP

Programmer
May 5, 2003
3
US
I have a report that has one or more records in a group sorted by date. One of the fields in record is a numerical value. These dates are grouped by month. At the end of 12 months, I only want to summarize the numerical field for the last record in each of the 12 groups. I cannot figure it out. Please help.
 
There are two methods, using a running total. First,if you reorder your detail fields (by changing the sort to the reverse of its current direction) so that the "last" record that you want summarized is your first, you can do the following:

Select the field you want to summarize {table.number}, sum, evaluate on change of group, reset never.

You could also define the particular record you want counted by using "evaluate using a formula" and entering:

{table.field} = maximum({table.field},{group.field}) //where {table.field} is a date or an ascending numerical field that defines the last record

Reset never. Both running totals belong in the report footer or a higher order group footer, depending on your report needs.

-LB
 
OK,

I changed the sort to be decending, then moved my printed fields to the group header, then used a summary total the necessary field. All works well. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top