Reputation: 77
I am running into a problem when I pull in the city name from my database that includes the 2 character state abbreviation at the very end.
Examples
CITY
WELLSBURG WV
FRANKFORT NY
ORANGE TX
I thought I could fix the problem by using the following SUBSTR function, but the table holds 27 characters which adds spaces at the end of each string to fill the 27 character requirement. Therefore, I'm not able to use the function because the spaces at the end of each result varies.
SUBSTR(S.CITY_NAME, 1, LENGTH(S.CITY_NAME)-2) AS "CITY"
I appreciate any suggestions to get around this issue.
Upvotes: 1
Views: 10453