Hello all -
Have to separate the state & the city from the address_3 field:
My code does not work in case if there is no coma in the field:
NEW YORK becomes NEW YO = city & RK = state or
Here is my code:
thanks for your help!
cristi
Have to separate the state & the city from the address_3 field:
My code does not work in case if there is no coma in the field:
NEW YORK becomes NEW YO = city & RK = state or
Here is my code:
Code:
SELECT address_3,
SUBSTR(ADDRESS_3,1,CASE
WHEN POSSTR(ADDRESS_3,',') = 0
THEN LENGTH(RTRIM(ADDRESS_3))-2
ELSE POSSTR(ADDRESS_3,',')-1
END ) as city
,RIGHT(RTRIM(ADDRESS_3),2) as state
from member
thanks for your help!
cristi