Results 1 to 5 of 5
  1. #1
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862

    Find records not found in INNER Join

    I am running updates on my tblFasTrakTrans using multiple sets of criteria from tblMaster. I have several different sets of criteria that I can not update in a single pass. The result is I have some orphans in tblFasTrakTrans.



    I want to focus on the remaining records in tblMaster that DO NOT have their PK in the respective FK field for tblFasTrakTrans

    Is there a way I can employ an Inner Join query like this….
    Code:
    SELECT tblMaster.KeyPK, tblFasTrakTrans.IDPK, tblFasTrakTrans.KeyFK
    FROM tblMaster INNER JOIN tblFasTrakTrans ON tblMaster.KeyPK = tblFasTrakTrans.KeyFK;
    to then find records in tblMaster that do not have a foreign key in tblFasTrakTrans?


    .
    Thanks for any sugestions.

  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,652
    Sounds like you want the unmatched query wizard (the frustrated left join method). Or am I goofed up?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I have never tried the Unmatched Wizard before. I launch the Wizard and it asks a bunch of questions. I keep answering yes and clicking the tables, etc. All the time I am thinking, great this is what I need. After the wizard is done it gave me the results I am looking for.

    Then I look at the SQL and start to kick myself. I know I built out a left join like this prior! Anyway, thanks for all of your help. If anything, you and the wizard has helped talk me through this.

    I am going to keep the thread open a little longer and run the results through the gauntlet of "fun times". Hopefully I am overcomplicating things and will use this left join query to create an elegant approach.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    That is what I needed. A left Join and criteria of Null for the FK.

    Paul,

    Thank you for taking the time to read my question and then understanding it too.

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

Similar Threads

  1. Replies: 8
    Last Post: 11-04-2011, 06:52 AM
  2. Need some help with a No Records Found query
    By kilosierra71 in forum Queries
    Replies: 1
    Last Post: 08-19-2011, 02:56 PM
  3. MsgBox for no records found
    By Lxmanager in forum Forms
    Replies: 4
    Last Post: 11-02-2010, 12:31 PM
  4. Replies: 1
    Last Post: 04-29-2010, 05:22 PM
  5. Return 0 if no records found
    By skwilliamson in forum Programming
    Replies: 1
    Last Post: 12-01-2009, 10:54 AM

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