Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting State out of City, ST

Status
Not open for further replies.

Zbob

MIS
Apr 25, 2002
94
US
I have state stored as "City, ST ZIP" Address3

I need to extract the ST out of this string.

Any ideas????
 
FORMULA : Mid ({Table.Address3},(InStr ({Table.Address3},"," )+ 2), 2)

Hope it Helps...
 
To be safe, change it to:

trim(Mid ({Table.Address3},(InStr ({Table.Address3},"," )+1),2))

And swat the dba around for allowing data to be stored this way.

Another interesting way you might do this would be:

split({table.address3}," ")[2]

-k
 
I think using the mid and instr functions is the way to go--if you used the split function this way you'd get "York" for "New York, NY 12345".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top