What is wrong with this statement that it is still giving me spaces after the field. This makes me think that the syntax combining the when statements is off. My boss wants them combined in one statement can someone help me understand what I am doing wrong?
Case WHEN LTRIM(RTRIM(cSHortName))= '' Then NULL
WHEN cShortname is NOT NULL THEN
REPLACE (cShortName,SUBSTRING,(cShortName,PATINDEX('%A-Za-z0-9""},1,) ''_
end AS SHORT_NAME