i get wrong result in a sum operation in a report

G

Guest

i have a repot that contains two joined tables (employee and department) the
records of one table are repeated with every record in the other table for
example the salary of the same employee is repeated with every department the
employee works in then when i calculate the sum of the salaries of the
employees in a certain company the result is wrong because the reports sums
up the salary of the same employee many.
so i need your help thanx
 
A

Allen Browne

Since you cannot just sum the repeated fields, you can use a Running Sum
text box to collect the salaries for each employee, and display the result
in the report footer.

1. In report design view, open the Sorting And Grouping box (View menu.)

2. In the dialog, choose the EmployeeID field (primary key of Employee
table), and in the lower pane, set Yes for Group Footer (or header if you
prefer.)

3. In the group footer section, add a text box with these properties:
Control Source Salary
Running Sum Over All
Name txtSalaryRS
Visible No

4. In the Report Footer section add a text box with these properties:
Control Source =[txtSalaryRS]
Format Currency
 

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