Sum calculation based on other field value

R

Rita

Hi,
On a report, I want the sum of a field based on criteria of another
field.

An example of the fields are:
a field called Salaries and a field called Position. The data in the
Position field states either "Manager" or "Clerk" and I need the salary sum
on the report for each position.

Something like =sum([salary] where emp = "manager") in a text box on the
report. Obviously this is
incorrect because it doesn't work. Any/all help is most appreciated.

Thanks.
 
M

Marshall Barton

Rita said:
On a report, I want the sum of a field based on criteria of another
field.

An example of the fields are:
a field called Salaries and a field called Position. The data in the
Position field states either "Manager" or "Clerk" and I need the salary sum
on the report for each position.

Something like =sum([salary] where emp = "manager") in a text box on the
report. Obviously this is
incorrect because it doesn't work. Any/all help is most appreciated.


What you asked for is a total of all manager salaries,
clerks, etc. This is not an appropriate thing to do as part
of a report's calculations.

Instead, you should create a subreport based on a totals
query that groups on the position field.
 
R

Rita

Thanks so much. That is actually so logical, I'm ashamed I didn't think of
it.
RT


Marshall Barton said:
Rita said:
On a report, I want the sum of a field based on criteria of another
field.

An example of the fields are:
a field called Salaries and a field called Position. The data in the
Position field states either "Manager" or "Clerk" and I need the salary
sum
on the report for each position.

Something like =sum([salary] where emp = "manager") in a text box on the
report. Obviously this is
incorrect because it doesn't work. Any/all help is most appreciated.


What you asked for is a total of all manager salaries,
clerks, etc. This is not an appropriate thing to do as part
of a report's calculations.

Instead, you should create a subreport based on a totals
query that groups on the position field.
 

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