Link to home
Start Free TrialLog in
Avatar of DocB1973
DocB1973Flag for United States of America

asked on

Parsing City and State From One Field

I've read all of the post and I don't think this one has been answered.  I have a field that has CITY ST.  I need to break them out into two fields.  No commas just a space between CITY and ST.  I've already done the ST as that was the easy part.  Also, the solution needs to be something I can put into a query.  Thanks for your help.
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image


try this query

select field,left([field],instr([field]," ")-1) as City, mid([field],instr([field]," ")+1) as State
from tableName
Avatar of DocB1973

ASKER

Thank for the quick reply.  It handles everything except when the city has more than one name.  Exp: Grand Rapids MI.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Fantasic!  Works like a charm.
Great job for something you think you know how to do but it turns out it's more difficult than you think.