sql - ISNULL not replacing with NULL -


i have following code -

   select        br_csno [party_key],        'w' [phone_type_cd],        isnull( ltrim( rtrim( fac_telno ) ), '0' ) [phone_num],        null [update_dt],        getdate() [batch_dt]           base b 

i following result -

enter image description here

it not replacing null. why? because of wrong placement or usage of ltrim(rtrim()) ?

edit

sorry limited knowledge of sql. want trim fac_telno , replace null if 0

i think wanted. sorry causing confusion!

select        br_csno [party_key],        'w' [phone_type_cd],        nullif( ltrim( rtrim( fac_telno ) ), '0' ) [phone_num],        null [update_dt],        getdate() [batch_dt]           base b 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -