473,836 Members | 1,444 Online

# Report calculations are wrong on some records but not others

On some records, the calculation is correct but on others it is wrong, why?

the calculation is as follows (the source of each part of the calculation is
below it):

txtActualWage =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue =rptLaborSubRep ort!TotalLaborC ost
TotalLaborCost =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)
txtTotalHours =Sum(DateDiff(" n",[StartTime],[EndTime])/60)

So in example one...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
\$25.00 \$912.50 36.50

in example two...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
\$23.00 \$187.50 7.50

why is this wrong? are my calculation to complex? using too many calculated
controls for the end result?

Any guidance greatly appreciated.
Apr 21 '07 #1
6 1647
Kevin wrote:
On some records, the calculation is correct but on others it is wrong, why?

the calculation is as follows (the source of each part of the calculation is
below it):

txtActualWage =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue =rptLaborSubRep ort!TotalLaborC ost
TotalLaborCost =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)
txtTotalHours =Sum(DateDiff(" n",[StartTime],[EndTime])/60)

So in example one...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
\$25.00 \$912.50 36.50

in example two...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
\$23.00 \$187.50 7.50

why is this wrong? are my calculation to complex? using too many calculated
controls for the end result?

Any guidance greatly appreciated.

What if there are no hours, i.e. Salary Employee?
Apr 22 '07 #2
Are you pulling in your labor revenue and your total hours separately so
that you can be sure the are pulling in correctly?

"Kevin" <no**@email.com wrote in message
news:xc******** *************@f e07.news.easyne ws.com...
On some records, the calculation is correct but on others it is wrong,
why?

the calculation is as follows (the source of each part of the calculation
is below it):

txtActualWage =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue =rptLaborSubRep ort!TotalLaborC ost
TotalLaborCost =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)
txtTotalHours =Sum(DateDiff(" n",[StartTime],[EndTime])/60)

So in example one...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
\$25.00 \$912.50 36.50

in example two...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
\$23.00 \$187.50 7.50

why is this wrong? are my calculation to complex? using too many
calculated controls for the end result?

Any guidance greatly appreciated.

Apr 22 '07 #3
Are you pulling in your labor revenue and your total hours separately so
that you can be sure the are pulling in correctly?
yes...
>txtActualWag e =[txtLaborRevenue]\[txtTotalHours]
txtLaborRevenue pulls from a calc control on rptLaborSubrepo rt,
TotalLaborCost. This calculated control, TotalLaborCost uses the
calculation - =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

and txtTotalHours is from the same subreport, a control named txtTotalHours
which uses the following calculation -
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)

I toyed with the idea of a rounding discrpency but that doesnt seem to fit.
The data type for the various fields are appropriate; StartTime EndTime are
both Date/Time fields, Pay is a currency field. As for the formatting of the
calculated controls; txtTotalHours is Fixed with 2 decimals, txtLaborRevenue
is Currency and txtActualWage is currency.
Apr 22 '07 #4
I'm not sure I see where this is relevent to the question at hand?

"Last Boy Scout" <Ba*****@whiteh ouse.govwrote in message
news:_Q******** ****@newsfe03.l ga...
What if there are no hours, i.e. Salary Employee?

Apr 22 '07 #5
So if you have your two fields pulling in correctly, the revenue field and
the hours field, have you tried running your calculation from these two
fields and not pulling the information from the subreport?

"Kevin" <no**@email.com wrote in message
news:da******** *************@f e08.news.easyne ws.com...
>Are you pulling in your labor revenue and your total hours separately so
that you can be sure the are pulling in correctly?

yes...
>>txtActualWa ge =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue pulls from a calc control on rptLaborSubrepo rt,
TotalLaborCost. This calculated control, TotalLaborCost uses the
calculation - =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

and txtTotalHours is from the same subreport, a control named
txtTotalHours which uses the following calculation -
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)

I toyed with the idea of a rounding discrpency but that doesnt seem to
fit. The data type for the various fields are appropriate; StartTime
EndTime are both Date/Time fields, Pay is a currency field. As for the
formatting of the calculated controls; txtTotalHours is Fixed with 2
decimals, txtLaborRevenue is Currency and txtActualWage is currency.

Apr 22 '07 #6
Rather than using the calculation =[txtLaborRevenue]\[txtTotalHours], I
substitued the formulas from the calculated fields on my report
(txtLaborRevenu e & txtTotalHours) and the calculations are correct. What
would account for the discrepency? Could this be a rounding issue?

"Scott" <sc**********@n s.sympatico.caw rote in message
news:2y******** ************@ur sa-nb00s0.nbnet.nb .ca...
So if you have your two fields pulling in correctly, the revenue field and
the hours field, have you tried running your calculation from these two
fields and not pulling the information from the subreport?

Apr 22 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.