Home Forums Article Discussions Article Discussions by Author Discuss content posted by Tom Brown Computed Column Divide by Zero? RE: Computed Column Divide by Zero?
Carlo Romagnano
SSC-Insane
Points: 22600
More actions
October 14, 2010 at 1:24 am
#1236659
henrik staun poulsen (10/13/2010)In order to get round the divide by zero error, I generally do this:PF1 AS QF1 / nullif((QF1 + QF2),0),instead ofPF1 AS QF1 / (QF1 + QF2),
henrik staun poulsen (10/13/2010)
PF1 AS QF1 / nullif((QF1 + QF2),0),
instead of
PF1 AS QF1 / (QF1 + QF2),
Good. The computed column should be NULL, if expression is invalid.