Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 case statement ?

Author  Topic 

jpockets
Starting Member

45 Posts

Posted - 2007-05-09 : 11:23:21
I have a case statement:
(AVG_Excess*1.0) / CASE Bound WHEN 0 THEN 1 ELSE Bound END AS Avg_SIR_Excess


I want to add null as a when statement with 0 is this correct syntax to use:

(AVG_Excess*1.0) / CASE Bound WHEN 0 or NULL THEN 1 ELSE Bound END AS Avg_SIR_Excess


Thanks!

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-09 : 11:26:48
[code](AVG_Excess*1.0) / CASE WHEN Bound = 0 or Bound IS NULL THEN 1 ELSE Bound END AS Avg_SIR_Excess[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -