Skip to Content
0

Division by zero

Oct 04, 2017 at 09:24 PM

26

avatar image
Former Member

I have the following formula, I get the Division by zero errors message. The SThous, OT1hours , or OT2hours , any of them could be zero, but at least one of them is not zero.

if {Employee.qHourSal} = "H"

then

(({@STHours} + {@OT1Hours} + {@OT2Hours}) * {PayrollEarnings.qSTRate}) +{@Benefits}*(({@STHours} + {@OT1Hours} + {@OT2Hours})/({@STHours} + 1.5*{@OT1Hours} + 2*{@OT2Hours})) + {@AddlComp}

else

// S {@STWages} + {@Benefits} + {@AddlComp}

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Ian Waterman Oct 05, 2017 at 08:17 AM
0

Why is you else condition commented out

Try

if {Employee.qHourSal} = "H"

then
(If {@STHours} + 1.5*{@OT1Hours} + 2*{@OT2Hours} = 0 then 0 else
(({@STHours} + {@OT1Hours} + {@OT2Hours}) * {PayrollEarnings.qSTRate}) +{@Benefits}*(({@STHours} + {@OT1Hours} + {@OT2Hours})/({@STHours} + 1.5*{@OT1Hours} + 2*{@OT2Hours})) + {@AddlComp}
)
else

S {@STWages} + {@Benefits} + {@AddlComp}

Share
10 |10000 characters needed characters left characters exceeded