help with summing fields in repot

C

Carla

I have a field called ponts assigned in a report. It uses an if statement to
assign points based on which class my students are attending.

I want to sum the total points accrued for each student. In the detail section
I made sure I named the if statement field pointsassigned and then I entered
a text box with =sum([pointsassigned])
when I run the report, It doesn't recognize pointsassigned. I checked
spelling etc.

I even tried =abs(sum([pointsassigned]))

it doesn't recognize the name I assigned. Any thoughts on what I am doing
wrong ?

I appreciate any help

Thanks
 
A

Al Campagna

Carla,
Sounds like you're trying to sum a "calculated" field on your report.
Claculated fields on the report can not be "directly" added.
Try doing the calculation in the query behind the report, instead of on
the report.

For instance, instead of doing a calculation on your report...
Price * Qty
add that calculation to your query...
LineTotal : Price * Qty

Now, place LineTotal on the report, and...
=Sum(LineTotal)
can be added up in any 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."
 
J

Jackie L

Carla,

The best way to do this is to put your if statement in the query that is
running your report (if you are running off a table, use a query instead
because of the formulas), then you can sum that field in your footer.

Otherwise, you will have to put a text box in your footer with sum in front
of your if statement for the total points.

Jackie
 
J

John Spencer

Is the field named POINTS? And the CONTROL in the report named PointsAssigned?

Then set the control PointsAssigned source to
= Sum([Points])

You must use fields when you Sum, Count, or Avg. You cannot use controls.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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