# Calculated Field **Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5) **Created:** 2016-12-05 18:58 UTC **Views:** 3715 **Replies:** 3 **URL:** https://www.epiusers.help/t/calculated-field/36509 --- ## Post #1 by @ajr117 Doing a BAQ and I have this calculated field in it ( JobAsmbl.TLESetupHours + JobAsmbl.TLEProdHours ) / ( JobAsmbl.TLASetupHours + JobAsmbl.TLAProdHours ) the syntax is OK but it returns Severity: Error, Table: , Field: , RowID: , Text: Divide by zero error encountered. when I run the query any suggestions --- ## Post #2 by @Aaron_Moreng Try using a case statement so that it doesn't automatically fail if you divide by zero. Ex. Case when JobAsmbl.TLESetupHours is not null then ( JobAsmbl.TLESetupHours + JobAsmbl.TLEProdHours ) / ( JobAsmbl.TLASetupHours + JobAsmbl.TLAProdHours ) end --- ## Post #3 by @Olga see example here http://stackoverflow.com/questions/861778/how-to-avoid-the-divide-by-zero-error-in-sql you need to use nullif in denominator --- ## Post #4 by @askulte Thanks Olga! Saved my morning. --- **Canonical:** https://www.epiusers.help/t/calculated-field/36509 **Original content:** https://www.epiusers.help/t/calculated-field/36509