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 -

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
Post a Comment