Results 1 to 5 of 5
  1. #1
    AccessThomas is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    26

    Getting duplicates entries in query

    Using Access 2013.

    In the query for B Church I should be receiving 6 records, but it is bringing back 12 records. I think if the qty is more than one or more than one type, it is causing a problem. How would I go about fixing this? Thanks for any help.

    Table 1
    Name Type Qty Connection
    J Smith 170 1 2
    S Jones 171 1 3
    B Church 170 2 2
    B Church 171 4 3

    Table 2
    Name Type serial
    J Smith 170 55
    S Jones 171 56
    B Church 170 57
    B Church 170 58
    B Church 171 59
    B Church 171 60
    B Church 171 61
    B Church 171 62


    Query
    Name Type serial Connection
    J Smith 170 55 2
    S Jones 171 56 3
    B Church 170 57 2
    B Church 170 57 3
    B Church 170 58 2


    B Church 170 58 3
    B Church 171 59 2
    B Church 171 59 3
    etc, etc

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    if you don't need the serial# remove it , pull uniques.
    otherwise the Tbl1 2 recs X tbl2 6 recs = 12 recs.

    join the namne fields and the type fields. not sure what you want as a result.

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Your query is doing exactly what it should do. I assume you are joining the tables on the field "name" (only). There two records for "Church" in table 1, and for each of them there are 6 matches in table 2. That gives you 2 x 6 = 12 possible matches, and it is what you should expect. It has nothing to do with whether "quantity" is > 1 or not.

    How you fix it depends entirely on what you want your query to do, and you haven't stated that.

  4. #4
    AccessThomas is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    26
    I want the query to have these results for B Church. Shouldn't be any duplicate serial numbers.

    NAME TYPE SERIAL CONNECTION
    B Church 170 57 2
    B Church 170 58 3
    B Church 171 59 2
    B Church 171 60 3
    B Church 171 61 2
    B Church 171 62 3

    There should be 6 records. Two for type 170 and four for type 171.

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Try linking the tables on both Name and Type. That will uniquely define the Connection for each Name - Type combination.

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

Similar Threads

  1. Replies: 3
    Last Post: 01-18-2016, 01:55 PM
  2. Query Duplicates
    By sgremp1 in forum Queries
    Replies: 4
    Last Post: 08-22-2014, 06:06 PM
  3. Replies: 11
    Last Post: 03-13-2014, 09:54 AM
  4. Replies: 15
    Last Post: 01-17-2014, 12:08 PM
  5. Duplicates in Query
    By Dega in forum Queries
    Replies: 1
    Last Post: 05-02-2010, 05:09 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