Results 1 to 2 of 2
  1. #1
    TheBigMaple is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    1

    Selecting the State Code


    So I have a bunch of address that have:

    Street Address City St Zip

    Nothing is standardized accept the order. There could be a comma between city and state and there may or may not be a space between the state and zip. The zip also varies in size (#####, #####-####, or #########). Sometimes the zip is not there at all. I am looking for a way to identify the State or at least the position that is starts at. Any help would be awesome.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Well you could start by assigning a unique identifier to every record.

    You can get a zip - state list for free here http://www.zipcodeworld.com/zipcodefree.htm
    With zip you can get state
    Once done
    For zips:
    go to the far end of the record and get the last 10 characters.
    Create another table that has the unique number, and the last 10 chars.
    Now, parse those 10 characters from right end . goal is unique number and proper zip

    a) could by state + 5 digit zip
    b) could be part of state and space + 5 digit zip
    c) could be space or Alpha + 9 digit zip
    d) could be 5 DIGITS + DASH +4 digits
    e) maybe more???


    Similar approach to State and remaining fields.

    Bottom line is that the approach probably depends on what you want to do with the result.
    You don't say you need the whole address... etc.
    Good luck

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Verify state field
    By pwmichaelsr in forum Access
    Replies: 5
    Last Post: 08-16-2010, 12:49 PM
  2. Triple State checkbox scroll order
    By lfox in forum Forms
    Replies: 7
    Last Post: 06-26-2010, 08:19 AM
  3. Selecting Dates
    By jpalk in forum Queries
    Replies: 3
    Last Post: 05-21-2010, 06:08 AM
  4. Selecting between two dates
    By nicorvp in forum Queries
    Replies: 5
    Last Post: 05-04-2010, 08:17 AM
  5. Pause state?
    By Zermoth in forum Programming
    Replies: 1
    Last Post: 12-15-2008, 05:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums