WHERE F.STORE_NBR = S.STORE_NBR AND F.ITEM_NBR = S.ITEM_NBR AND F.ITEM_NBR = P.ITEM_NBR AND F.ITEM_NBR = I.ITEM_NBR AND F.ORIG_VAL>0 AND F.SUB_VAL >0 AND F.ORIG_VAL <> REC_TTL
-- AND ABS(REC_VAL - ORIG_VAL)>3
with the last line commented out, the query runs.
remove the comments, the divide by zero error is returned
WHERE F.STORE_NBR = S.STORE_NBR
AND F.ITEM_NBR = S.ITEM_NBR
AND F.ITEM_NBR = P.ITEM_NBR
AND F.ITEM_NBR = I.ITEM_NBR
AND F.ORIG_VAL>0
AND F.SUB_VAL >0
AND F.ORIG_VAL <> REC_TTL
-- AND ABS(REC_VAL - ORIG_VAL)>3
with the last line commented out, the query runs.
remove the comments, the divide by zero error is returned