cancel
Showing results for 
Search instead for 
Did you mean: 

Division by zero

Former Member
0 Kudos

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}

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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}