Strange equation behavior

I

idtjes3

Hello

I am calculating overtime hrs on a report but running into a bit of a
snag. On my report i have a text box ( PayPeriodHrs ) which is populated from
a Pay Period Selection form( You select the start, end date, and input the
total hrs for the period, then press a button to launch the report). All the
hours with dates in between the start and end date are placed in the report
and the total pay period hours are working perfectly. I have a text box,
txtSumOfHrsTotal, which "Sums" all the hours between the dates for a
particular employee. Another text box, txtRegularTimeHrs, which calculates
only regular tme worked by using: =[txtSumOfHrsTotal]-[txtOvertimeHrsTotal] .
Lastly, I have a box, txtOvertimeHrsTotal, to calculate over time hours by
the equation;
=IIf([PayPeriodHrs]<[txtSumOfHrsTotal],[txtSumOfHrsTotal]-[PayPeriodHrs],0)

The equation above is only working for a few employees though. For
instance, I entered 6 for PayPeriodHrs and one worker worked 8 hrs(1 day, 1
record) so txtSumOfHrsTotal=8, txtRegularTimeHrs=6, and
txtOvertimeHrsTotal=2. But i also have an employee who worked 16 hrs ( 2
days, 2 records) which is giving me txtSumOfHrsTotal=16, txtRegularTimeHrs=16
and txtOvertimeHrsTotal=0. This is also happening to an employee who has
worked 24hrs ( split between 4 seperate records).

Why is this? Does it have to do with the fact the 16 hrs is from 2
records? Since the equation is basing off the contents of the SumOfHrsTotal
shouldn't that not even matter? Is my equation to blame? Thanks.
 
I

idtjes3

One more thing, When i threw a " 1" into the pay period hrs box, the
employees with 16 hrs worked now displayed the correct information; Total hrs
worked = 16, regular time=1, over time = 15. Is there a problem with the
number format or something?
 

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