I am getting an error in a view:
[Microsoft][ODBC SQL Server Driver][SQL Server]Divide by zero error encountered
It is caused by a calculation I have that divides one column by another to make a third column. some of the values in the "divide by" field are zero. This never used to cause an error until just today....strange.
The calculation is as follows:
CAST(ROUND(db.FIELD1.UNITS / (db.TABLE2.FIELD2 * 0.0001), 2) AS decimal(10, 2)) AS DENSITY
Any suggestions as to how to avoid this error, while still keeping the zeros in the field?
thanks
ft
[Microsoft][ODBC SQL Server Driver][SQL Server]Divide by zero error encountered
It is caused by a calculation I have that divides one column by another to make a third column. some of the values in the "divide by" field are zero. This never used to cause an error until just today....strange.
The calculation is as follows:
CAST(ROUND(db.FIELD1.UNITS / (db.TABLE2.FIELD2 * 0.0001), 2) AS decimal(10, 2)) AS DENSITY
Any suggestions as to how to avoid this error, while still keeping the zeros in the field?
thanks
ft