Results 1 to 2 of 2
  1. #1
    kmullins76 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Posts
    1

    Query to merge matching data

    I have a table that is populated with demographic info (ZIP, State, City, County, etc.). In multiple instances I have duplicate ZIP codes because there is more than one city within the ZIP. Another column tells me exactly how many cities are within that particular zip code. What I am trying to do is write a query that will identify these anomalies and remove the extra rows and combine all the cities only column into one row keeping all the original data in that row. The only difference in the duplicate rows are the city name, the rest of the data is exactly the same.



    Something along the line of:
    =IF[ZIP match then merge city separated by commas…


    Thank you inadvance for your help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    A query alone can't do that, need VBA function. Review: http://allenbrowne.com/func-concat.html

    A column with an aggregate value such as the count of cities is not a good design. That count should be calculated when needed.
    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.

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

Similar Threads

  1. Using search field to find matching data
    By rthakral in forum Access
    Replies: 2
    Last Post: 08-19-2013, 12:18 PM
  2. Report Data Not Matching Query Results
    By Rawb in forum Reports
    Replies: 7
    Last Post: 10-25-2012, 01:41 PM
  3. Find matching data between 2 queries
    By michael.p.ryan1 in forum Access
    Replies: 3
    Last Post: 08-24-2012, 05:51 PM
  4. Data not matching with times
    By dumbee188 in forum Access
    Replies: 0
    Last Post: 07-08-2010, 01:54 PM
  5. Display Non Matching Data
    By k1fox in forum Access
    Replies: 1
    Last Post: 04-03-2009, 07:18 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