calculated control in access report

F

fredg

I need to sum a column based on criteria in another column. Can you help me

Not unless you care to give some more information, such as the field
names, the criteria, and where you wish to show the total.
 
M

Marshall Barton

jcp said:
I need to sum a column based on criteria in another column. Can you help me


Someone will probably be able to help, but not until you
explain more about "sum a column based on criteria in
another column"
 
J

jcp

My apologies, I have never posted like this. I have a report that has a
calculated control on it that says - =sum([Units]). It works, but I need to
expand it to say -
= sum ([units] if [Service code="0600","0800"]. The field names are Units
and Service code. The control in in the report footer.
Is this enough information?
 
M

Marshall Barton

jcp said:
My apologies, I have never posted like this. I have a report that has a
calculated control on it that says - =sum([Units]). It works, but I need to
expand it to say -
= sum ([units] if [Service code="0600","0800"]. The field names are Units
and Service code. The control in in the report footer.


Try writing it this way:

=Sum(IIf([Service code] IN ("0600","0800"), Units, 0)
 
J

jcp

That worked, thank you.

Marshall Barton said:
jcp said:
My apologies, I have never posted like this. I have a report that has a
calculated control on it that says - =sum([Units]). It works, but I need to
expand it to say -
= sum ([units] if [Service code="0600","0800"]. The field names are Units
and Service code. The control in in the report footer.


Try writing it this way:

=Sum(IIf([Service code] IN ("0600","0800"), Units, 0)
 
Top