Divide by Null - can this equal null?

Divide by Null - can this equal null?

Post by rayd » Fri, 10 Oct 2003 03:30:28


select case when columnName is null then null else value/columnName end from
...
 
 
 

Divide by Null - can this equal null?

Post by alex » Fri, 10 Oct 2003 03:31:19

Hi...

I'm writing a rather complex DTS script, and in one of my
calculations, it'll be dividing by a variable from one specific table.
Some of this data is null, so it's dividing by Null, which errors out
saying I'm dividing by zero.

Is it possible to tell MS SQL 2000 to produce a null in these cases
instead of erroring out? I have a huge list of numbers it's
calculating, and if it'll simply output a null, that'll work.

Thanks,

Alex.