I am having a hard time trying to figure out how to get rid of the trailing space. I have a field that has a full address. I need to take out the City, State and Zip.
addrLines = '2211 Otter Cir Fountain Valley, CA 92783'
City = 'Fountain Valley'
State = 'CA'
Zip = '92783'
Here is the line of code I am using:
RTRIM(REPLACE(cast(a.addrlines as varchar(250)), a.CITY + ', ' + a.STATE + ' ' + a.ZIP, ''))
Why am I still getting the trailing space?