calculated control in access report

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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"
 
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?
 
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)
 
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)
 
Back
Top