Results 1 to 2 of 2
  1. #1
    scott0_1 is offline Advanced Beginner
    Windows Vista Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    82

    Complicated unmatched query - help!

    Hi All,



    Instead of giving you the complicated setup I have, I'll let you know what I'm trying to accomplish with smaller, fake tables.

    I've got tblEmployee, tblCourseCatalogue and tblIndividualLearning. tblEmployee is a table with all employees and it's primary key is ID. tblCourseCatalogue is a table with all courses and employee can take and it's primary key is ID. tblIndividualLearning is a table that links the others. It's primary key is ID, with EmpID, CourseID and DateCompleted.

    I've got a query that lists what employees have completed a specific course. I now want to use that query as a subquery to list those that have not taken that specific course.

    I know the easy way is to create two separate saved queries, but like I said, the real thing is a little more complicated. I'm running the queries through VBA so I can use some variables to add in some custom search parameters.

    What I would like to know is how to write the whole SQL statement. SQL is not my forte!

    If someone could give me an example with the simple structure above, I will be able to pick through it and modify it for my needs.

    Thanks for the help as always!

    Scott

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Suggest you read this parallel thread https://www.accessforums.net/showthread.php?t=76399
    As you are referring to 3 tables, yours may be a little more complicated .
    However as you aren't confident in using code, build your query using the unmatched query wizard.
    Check that it does what you want then change to SQL view.
    Copy the SQL statement into your code and you may not need to save any queries

    If it helps use my SQL to VBA and back again utility to convert for use in your VBA
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. unmatched query trouble
    By Homegrownandy in forum Queries
    Replies: 17
    Last Post: 05-31-2017, 02:20 AM
  2. unmatched query wizard
    By Jen0dorf in forum Access
    Replies: 7
    Last Post: 12-05-2015, 11:58 AM
  3. Unmatched Query
    By Dog17 in forum Queries
    Replies: 3
    Last Post: 08-07-2014, 02:36 PM
  4. Unmatched Addresses Query
    By #1Newbie in forum Queries
    Replies: 3
    Last Post: 06-03-2013, 06:54 AM
  5. Replies: 1
    Last Post: 12-08-2011, 01:52 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