Results 1 to 6 of 6
  1. #1
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73

    Find instances where entries have the same address but different zip codes

    As the title states, I have a database where several entries may have the same address, but someone has been inputting some of the zip codes incorrectly. I want to come up with a way to get a query or the like to spit out a report with just the entries that have identical addresses and conflicting zip codes, and have hit a brick wall.

    Can anyone help? I appreciate you taking the time to read this. Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Sounds like structure is not normalized. Why is same address repeatedly typed in entirety? Is this for same customer?

    Fixing this probably won't be easy. Are the address parts in separate fields? Show example of raw data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73
    The data actually just ports over from Access from an outside program, so, no, it is not normalized. These are parcels, some of which have the same physical address that really serves a much larger area. Here is a small example of what I am dealing with. For my purposes, I am only concerned with Address2 and Zipcode.

    Sample.zip

    Thanks for taking the time to look at it.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would start by creating a select query with fields: Address1, Address2, City, State, Zip
    This is to check the zip code has been entered wrong for an address.

    Enter the address, City & state as criteria. If any zip codes are wrong, edit the zip code. If a lot of zip codes are wrong, change the query to (or create) an update query, enter the correct zip code for that address, city, state and execute.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Do a count of how many zips for each Address1, Address2, City, State combination.

    SELECT Address1, Address2, City, State, Count(Zip) As CountZip FROM tablename GROUP BY Address1, Address2, City, State;

    Look at the records where the count is greater than 1. Now you know which Address1, Address2, City, State combinations need to be fixed. Go to the source table and edit records to the correct zip.

    Of course, this assumes no errors in the other address parts.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    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,726
    Have you considered putting some validation at the source? Who makes/provides the "list" to you? Seems to me that cleaning up that process would make things more efficient.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-22-2013, 12:02 AM
  2. Find last used column address using vba
    By selvakumar.arc in forum Import/Export Data
    Replies: 2
    Last Post: 05-30-2013, 08:05 AM
  3. How to find Country by using the email address?
    By jamesfranklin in forum Programming
    Replies: 2
    Last Post: 03-07-2013, 07:07 AM
  4. Replies: 4
    Last Post: 11-17-2012, 03:07 PM
  5. Input Mask for an IP Address and Mack Address
    By baksg1995 in forum Access
    Replies: 18
    Last Post: 06-23-2009, 12:33 PM

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