Criteria sum in report

H

Hallgeir

I have a report looking something like this (just an example):

Id Value
1 2
2 4
3 1
4 2
5 3

In the report footer I want a field that gives me the sum for values with
id's between 2 and 4. Earlier I have solved this by making an extra query
and a subreport, but I'm wondering if it could be solved otherwise. Maybee
by using a sql sentence for the controllsource property on an ordinary
textbox.

Appreciate any suggestions
 
H

Hallgeir

Thank you! Just what I needed. (The Value field name was just a bad example)

--
mvh
hallgeir pettersen
unitech systems as
Allen Browne said:
Try something like this in the Control Source of a text box in the Report
Footer section:

=Sum(IIf([ID] Between 2 And 4, [Value], 0))

Hopefully you don't really have a field named Value. That's a reserved
word. More info:
http://allenbrowne.com/AppIssueBadWord.html
 

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