Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Posts
    2

    Unanswered: Update one Field based another

    I have been given the job to figure out how to insert County field information based on a ZipCode field in a database. The current database has a 9-digit zip code field. I have found information on 5-digit zips for all of the counties that I think are in the database and created a second table that simply has the 5-digit zips and the corresponding counties. Is there anyway to use this info to update the County field in the original database? Example: Original database ZipCode field - "17011-1234" or "17552-6789". From my other table I know that 17011 would be York County and 17522 would be Lancaster County. I am NOT a VBA expert -- have done a little bit with it. Any help would be appreciated. Thanks!

  2. #2
    Join Date
    Oct 2001
    Location
    Bay Area, CA
    Posts
    117
    Try this.. In a query.

    UPDATE tblCounties, tblOriginalTable SET tblOriginalTable.County = [tblCounties].[County]
    WHERE (((Left([tblOriginalTable].[Zip],5))=[tblCounties].[Zip]));

    Hope this helps....

  3. #3
    Join Date
    Mar 2002
    Posts
    2
    Thanks for the response! I will give it a try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •