Results 1 to 3 of 3
  1. #1
    dRAGZOR is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6

    inner join Query Suddenly Started duplicating rows

    This is a new problem I'm running into. There are no duplicates in either of my tables yet when I use a inner join it will duplicate rows seemingly randomly. I've tried to use SELECT DISTINCTROW but that doesn't help. I've also used SELECT DISTINCT which works perfectly however i am using two columns with a multifield datatype (.Elec and .Mech) so that will only work if those two columns are removed which I don't really want to do. Any help will be very much appreciated, I've spent the last couple hours pulling my hair out.



    Code:
    SELECT BillQuick_master.[Project Number], BillQuick_master.[Project Name], BillQuick_master.Phase, ProjectInfo.Status, ProjectInfo.[Due Date], ProjectInfo.[Project Manager], ProjectInfo.Elec, BillQuick_master.[Elec Hours Budgeted], BillQuick_master.[Elec Hours Spent], ProjectInfo.Mech, BillQuick_master.[Mech Hours Budgeted], BillQuick_master.[Mech Hours Spent], ProjectInfo.Notes, ProjectInfo.[Perc Complete]FROM BillQuick_master INNER JOIN ProjectInfo ON (BillQuick_master.[Project Number] = ProjectInfo.[Project #]) AND (BillQuick_master.[Project Number] = ProjectInfo.[Project #]);

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    for some reason you are repeating your join

    ON (BillQuick_master.[Project Number] = ProjectInfo.[Project #]) AND (BillQuick_master.[Project Number] = ProjectInfo.[Project #])
    also, may not be the reason but having spaces and non alphanumeric characters is a bad idea (# for example is used as a date delimiter in sql)

    but the reason for your duplicates is your multivalue field. When you use them, you lose some control. Having said that, I'm a bit confused, you said two columns - don't you mean two rows?

  3. #3
    dRAGZOR is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6
    Hey thank you for the lead on what the issue was. I ended up solving the issue by adding .value to the end of ProjectInfo.Elec and ProjectInfo.Mech and then using the SELECT DISTINCT

    I may have been using the wrong terminology about rows and columns. Thank you again!

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

Similar Threads

  1. Replies: 5
    Last Post: 06-19-2019, 01:04 PM
  2. Replies: 6
    Last Post: 09-10-2017, 08:13 PM
  3. Replies: 3
    Last Post: 05-14-2014, 01:30 PM
  4. Returning correct rows in a join/nested query
    By goneaccessing in forum Queries
    Replies: 5
    Last Post: 03-03-2010, 12:21 PM
  5. Problem with "join" duplicating records
    By Zukster in forum Queries
    Replies: 0
    Last Post: 08-25-2009, 09:00 AM

Tags for this Thread

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