calculating column totals in a report

G

Guest

I’m calculating payroll in a report:

Column 1
Begin Time

Column 2
End Time

Column 3
=DateDiff("n",[ActualBegin],[ActualEnd])/60

Column 4 - Hourly Rate

Column 5 - Actual Pay
=IIf([TotalHrs]*[Salary]>50,[TotalHrs]*[Salary],50)

Column 6 is an Override (to override previous calculations)

Column 7 - Expenses

Column 8 - TotalPay
=IIf(IsNull([Override]),[ActualPay],[Override])

Column 9 - Total
=[TotalPay]+[Expenses]

The calculations work perfectly but I cannot get the columns to add.
The fields where there are calculations i.e. ActualPay and TotalPay have the
code written directly into the field.

When I insert a field with:
=sum([ActualPay])
I get an error message where it does not recognize “ActualPayâ€

Please help!
Rhonda Marko
 
G

Guest

Unfortunately, I need the sum in the detail footer and it's not working.

LLKHOUTX said:
Sum your report fields in a report footer.
--
LLKHOUTX


R Marko said:
I’m calculating payroll in a report:

Column 1
Begin Time

Column 2
End Time

Column 3
=DateDiff("n",[ActualBegin],[ActualEnd])/60

Column 4 - Hourly Rate

Column 5 - Actual Pay
=IIf([TotalHrs]*[Salary]>50,[TotalHrs]*[Salary],50)

Column 6 is an Override (to override previous calculations)

Column 7 - Expenses

Column 8 - TotalPay
=IIf(IsNull([Override]),[ActualPay],[Override])

Column 9 - Total
=[TotalPay]+[Expenses]

The calculations work perfectly but I cannot get the columns to add.
The fields where there are calculations i.e. ActualPay and TotalPay have the
code written directly into the field.

When I insert a field with:
=sum([ActualPay])
I get an error message where it does not recognize “ActualPayâ€

Please help!
Rhonda Marko
 
D

Duane Hookom

You can't sum controls. You can sum expressions. Try something like:
=Sum( IIf([TotalHrs]*[Salary]>50,[TotalHrs]*[Salary],50))
If any of the above are calculated, replace it with the calculation.
 
T

Tom Lake

The calculations work perfectly but I cannot get the columns to add.
The fields where there are calculations i.e. ActualPay and TotalPay have
the
code written directly into the field.

When I insert a field with:
=sum([ActualPay])
I get an error message where it does not recognize "ActualPay"

You can't Sum a calculated field. You have to do this to sum ActualPay:

=Sum(IIf([TotalHrs]*[Salary]>50,[TotalHrs]*[Salary],50))

Tom Lake
 

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