SELECT Rtrim(Ltrim(case when (LongAddress is NULL or LongAddress='') then '' else substring(LongAddress, 1,CASE WHEN CHARINDEX('/',LongAddress) - 1 < 0 THEN LEN(LongAddress)
ELSE CHARINDEX('/',LongAddress) - 1 END) end)) as LongAddress,LongAddress from sampletable
No comments:
Post a Comment