sql case

Hi,

I have the sql case statement below that works fine, however if the cn.disableReason is null then I want to return 'In-Active'

CASE candidateactive WHEN 1 THEN 'Active'  WHEN 0 THEN cn.disableReason  END  AS Status

Greatful for any help.

Thanks
LVL 1
SolugaAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
I see
CASE WHEN candidateactive  IS NULL THEN 'In-Active' WHEN candidateactive  = 1 THEN 'Active'  WHEN candidateactive  = 0 THEN ISNULL( cn.disableReason, 'In-Active')  END  AS Status

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
CASE WHEN candidateactive  IS NULL THEN 'In-Active' WHEN candidateactive  = 1 THEN 'Active'  WHEN candidateactive  = 0 THEN cn.disableReason  END  AS Status
0
 
SolugaAuthor Commented:
Thanks,
Problem is if there is a null value in cn.diablereason then it overwrites 'in-active' with Null
0
 
SolugaAuthor Commented:
Excellent, thank very much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.