cancel
Showing results for 
Search instead for 
Did you mean: 

case expression

t1950
Participant
2,580

select c1, c2, c3,
( CASE when recon-status = '' then 'N'
when recon-status is null then 'NULL'
else recon-status END )
from ...

when recon_status = '', i'm not getting an N, i'm getting ''

ASA 11.0.1.2960

View Entire Topic
Breck_Carter
Participant

The question remains, how do you know that recon_status contains ''? Maybe it contains ' ' or ' ' (one or two or more spaces)... you can't tell from the screenshots.

Maybe you need TRIM...

( case when TRIM ( recon_status ) = '' then 'N'  
when recon_status is null then 'NULL'  
else recon_status end ) recon_status, 
t1950
Participant
0 Kudos

thank you Breck

my bad, it is a single space. i haven't had a space in a char column since i don't know when. it's a throw back to very old, old programming. as soon as i put '>' + recon_status + '<' in the select, the space showed up.