sum a MAX field on report footer

P

p-rat

I have a field that shows up in each record that I use MAX(field) on
my first report footer. No problems. I then need to SUM this on the
next several report footers. Does anyone have a clue how this can be
done.? When I use SUM(field) it counts all the individual records and
I just need it to sum the MAX value. Thanks for any insight on this.
 
A

Al Campagna

p-rat,
I think you mean you have a Max(SomeField) in a Group Footer. A report
has only one Report Footer, and that occurs only at the end of the report.

Set the Running Sum property for your Max field to Over All
That will add the max value, from each GroupFooter, to a grand total in
the last Group or Report Footer.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
P

p-rat

Actually yes, it's a group footer. Here's what I have:

group footer 4 = driver
group footer 3 = truck
group footer 2 = location
group footer 1 = date

each detail record is a truck ticket. the field i'm having an issue
with is a total field that i have coming from somewhere else that
shows driver hours. driver hours are not part of the truck ticket. so
i can either place the driver hours in the detail and then use MAX
(driver_hours) and place it in the group footer 4. i don't want a
running total on the next set of groups (3,2,1). i need the MAX
(driver_hours) field summed at each group footer. i tried what you
stated and it does not work. do you have any other ideas or am i
missing the point? thanks for your reply.
 
A

Al Campagna

P-rat,
Sorry, but I don't understand what you're trying to do.
Could you show a small sample of your report data, with groups and
sample values.
what you have... vs. what you want to see?.
If I still don't understand, or no one else jumps in with any ideas, it
might be best to do a new post.
--
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Actually yes, it's a group footer. Here's what I have:

group footer 4 = driver
group footer 3 = truck
group footer 2 = location
group footer 1 = date

each detail record is a truck ticket. the field i'm having an issue
with is a total field that i have coming from somewhere else that
shows driver hours. driver hours are not part of the truck ticket. so
i can either place the driver hours in the detail and then use MAX
(driver_hours) and place it in the group footer 4. i don't want a
running total on the next set of groups (3,2,1). i need the MAX
(driver_hours) field summed at each group footer. i tried what you
stated and it does not work. do you have any other ideas or am i
missing the point? thanks for your reply.
 
P

p-rat

I need the 'driverhours' which show up on detail rows to show as MAX
in the driver group footer. I hide this field on the detail row. I
need the driver hours to sum correctly on the location group footer
and other group footers including grand total. I can't get this to
work. Thanks again for any help.

columns: driver truckticket truckhours
driverhours shophours

DALLAS,TX

detail rows joe 12345 3.0
12.0 0.0
joe 23456 6.0
12.0 0.0
joe 34567 3.0
12.0 0.0
______________________________________________________________
joe 12.0
12.0 0.0


sam 98765 9.0
12.0 0.0
________________________________________________________________
sam 9.0
12.0 3.0


DALLAS total 21.0
24.0 3.0

GRAND total , etc.
 
A

Al Campagna

p-rat,
When showing a sample table, please make it's width less
than 80 chars. Email Wraps anything over that
If you go too wide, your data will look like what's in
your revious post, and it's really difficult to work with that.
You could have dropped the Ticket,TruckHours, and
Shop Hours, as they are not germain to the issue you indicated.

It appears as though Joe and Sam each had a
Max DrvHours of 12 hrs, which will give Dallas a total
of 24. Correct?
See my * and ~ calculations below. That should give
you the sum of the Max DriverHours by City.

DALLAS,TX (City Header)
--------------------------
Driver Header
---------------------------
Drvr TTicket THours DrvHours ShpHours (Detail)
joe 12345 3.0 8.0 0.0
joe 23456 6.0 7.0 0.0
joe 34567 3.0 12.0 0.0
-----------------------------------------
joe 12.0 *12.0 0.0 (DrvrFooter)
------------------------------------------
sam 98765 9.0 12.0 0.0
sam 16523 9.0 6.0 0.0
-----------------------------------------
sam 9.0 *12.0 0.0 (DrvrFooter)
-----------------------------------------
DALLAS 21.0 ~ 24.0 0.0 (City Footer)
-----------------------------------------
GRAND total , etc. (Report Footer)

* Name = [DrvMaxHrs] =Max(DrvHrs)
~Name = [CityDrvHrs] =Sum(DrvMaxHrs)
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


I need the 'driverhours' which show up on detail rows to show as MAX
in the driver group footer. I hide this field on the detail row. I
need the driver hours to sum correctly on the location group footer
and other group footers including grand total. I can't get this to
work. Thanks again for any help.

columns: driver truckticket truckhours
driverhours shophours

DALLAS,TX

detail rows joe 12345 3.0
12.0 0.0
joe 23456 6.0
12.0 0.0
joe 34567 3.0
12.0 0.0
______________________________________________________________
joe 12.0
12.0 0.0


sam 98765 9.0
12.0 0.0
________________________________________________________________
sam 9.0
12.0 3.0


DALLAS total 21.0
24.0 3.0

GRAND total , etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top