Click here to Skip to main content
15,891,749 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have a query that needs a case when like:

case when 'a/b is error' then '10' else 'a/b' end

How can I detect that if there is an error?

Thanks..!!

What I have tried:

nullif function that does not seem to work and moreover it creates another level of checking.
Posted
Updated 9-Oct-17 21:20pm

1 solution

case when b = 0 or a is null or b is null then 10 else a / b end
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900