Results 1 to 5 of 5
  1. #1
    dmanonice is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2020
    Posts
    10

    Question Trouble with 2 table Query

    Hello Everyone,

    I am trying to create a query that pulls data from 2 tables and I have had no luck with trial and error (I am teaching myself Access as I go) to do what i want.

    In the first table I have the ID field, the date and the unit and a result, and the second table i have the ID field, the date, the unit, and various operational data. Due to data source formatting the ID fields are not the same in each table. The units are the same in both tables, just in different order and repeat every day.



    What i would like to do, is select a unit and result for table 1, the result is a Yes or No, and then from the second table pull the operational data that matches the unit number and date.

    So for example I would select the Unit "B" and the result "N" and that query returns 5 results. I want to then bring over the operational data from the second table using the unit and date from the 5 results of the first query.

    I have the first query created and functioning properly, I am lost at how to get the second part done.

    I hope this all logical and can be done, doing it by hand right now and thinking there must be a better way.

    Thanks

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,122
    Without a sample db and some desired input/output examples is hard to get you an answer, but have you tried to join the two tables by both unit and date fields (two join lines going from one table to the other)?

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    dmanonice is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2020
    Posts
    10
    I have attached a sample db with the data that I am trying to get to work. I have the first part of the query set up but have cleared everything else. I have tried the double join but I may be doing something wrong, I am a complete newbie at Access and am learning as I go. not too concerned about output, I am can fiddle with the output and know how to manipulate reports and the query formatting. I just want the data all in the same place at the moment.

    So the query right now pulls the data as i want it to, now i want that query data result to pull all fields from table 2 into the same query result, without duplicating the date and unit.
    Attached Files Attached Files

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,122
    Is this what you're after?
    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    dmanonice is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2020
    Posts
    10
    Yes that is exactly what i am looking for. The set up looks similar to what I tried before, I must have done something wonky in my first attempts.

    Thank you very much for the help!

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

Similar Threads

  1. Trouble with table relationships
    By barrensb in forum Database Design
    Replies: 3
    Last Post: 05-28-2019, 06:21 PM
  2. Trouble appending a table
    By Gryphoune in forum Access
    Replies: 9
    Last Post: 01-27-2016, 12:42 PM
  3. Replies: 14
    Last Post: 09-13-2012, 01:15 PM
  4. Replies: 9
    Last Post: 08-31-2012, 12:00 PM
  5. Trouble linking a table to a query
    By wtubell in forum Queries
    Replies: 1
    Last Post: 03-26-2009, 06:34 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