Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006
    Posts
    65

    Unanswered: Creating a query to exclude reesults from previous query

    Hi,

    i have previously ran 2 queries, one displays client ID before a perticular parameter date, one displays after a given date. I wish to run a third query to exclude Client ID that were included in results of running query1 and query2.

    Can anyone please advise on how to do this without manually excluding the client ID in query3, please bear in mind that i am a beginner!

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Just a quick response here, have you tried out the Find Unmatched part of the Query Wizard? That will show you the fundamental way of doing what you want.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Apr 2006
    Posts
    65
    i have tried but it will not let me group the two queries together,

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Look at the NOT IN operator.
    For example
    Code:
    SELECT firstname
         , surname
    FROM   people
    WHERE  employee_id NOT IN (
            SELECT employee_id
            FROM   leavers
           )
    George
    Home | Blog

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    Look at the NOT IN operator.
    Worth testing - apart from a few specific cases EXISTS is (typically) more efficient than NOT IN (though I am on much firmer ground with SQL Server than JET in this case).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •