Results 1 to 5 of 5
  1. #1
    millsk is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    2

    Query Limiting data shown between two databases..

    I have two data bases. The first one has a list of equipment. This list comprises of 17,000 unique objects. (primary key)



    The second data base is a smaller list (11K) of the same equipment. It is smaller because not all the equipment has maintenance performed to it. It shows the equipment number and a number corrisponding to the type of maintenance performed on the equipment. This list has duplicates in it because sometimes equipment has more then one type of maintenance performed to it.

    I am attempting to show the first long list of equipment, and include it it any maintenance type that is performed on it. I would like this list to include all 17k objects even if they do not have maintenance performed.

    Currently when I run the query only the 11k show.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sounds like you need to change the join between the tables. With the query in design view, right click on the join line to edit it. You should see the correct option at that point.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    oops, I see Paul beat me to the punch

    I assume that when you say you have two databases, you actually mean you have 2 tables.

    You will need to change the join type between the two tables. When you get only the 11k records you are only matching those records of the larger table that have related records in the smaller table. If you look at the query in SQL View you will see an INNER JOIN between the two tables. What you need is a left join.

    FROM largertable LEFT JOIN smallertable ON largertable.IDfield=smallertable.IDField

    If you are using the design grid view, right click on the join line between the two tables and select the option to include ALL records from the larger table as well as those records from the smaller table that match

  4. #4
    millsk is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    2
    Problem solved. Thank you much!

  5. #5
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You are welcome. Good luck with your project.

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

Similar Threads

  1. Edit record in form with original entry shown
    By erknoebe in forum Access
    Replies: 5
    Last Post: 09-29-2010, 02:33 PM
  2. Replies: 4
    Last Post: 07-28-2010, 10:27 AM
  3. Replies: 0
    Last Post: 03-01-2010, 02:53 AM
  4. append query for multiple databases
    By vasto in forum Access
    Replies: 0
    Last Post: 09-24-2009, 08:34 AM
  5. VBA SQL Query of Multiple Databases
    By VBA_Rookie in forum Programming
    Replies: 0
    Last Post: 12-02-2008, 12:32 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