Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    2

    Unanswered: Exclude data from one table

    Hi,

    I have a table like:

    tbl 1:
    Name Group
    Ed......1
    John...2
    Bill......3
    Jack....4


    and a table like:
    tbl 2:
    Name
    John
    Ed

    and I want to return a table that includes all of the names from tbl 1 but that does not include any names in tbl 2.

    ie returns:
    Name Group
    Bill 3
    Jack 4

    Any ideas?

  2. #2
    Join Date
    Sep 2003
    Location
    Washington, DC
    Posts
    116
    Quote Originally Posted by Chiba5000
    Hi,

    I have a table like:

    tbl 1:
    Name Group
    Ed......1
    John...2
    Bill......3
    Jack....4


    and a table like:
    tbl 2:
    Name
    John
    Ed

    and I want to return a table that includes all of the names from tbl 1 but that does not include any names in tbl 2.

    ie returns:
    Name Group
    Bill 3
    Jack 4

    Any ideas?
    You need to create a query where you join the Name field from both table so that all the records from table 2, and only those in table 1 that are equal. You can use the find unmatched query wizard in Access or do this:

    SELECT tbl2.[Name]
    FROM tbl1 RIGHT JOIN tbl2 ON tbl1.[Name] = tbl2.[Name]
    WHERE (((tbl1.[Name]) Is Null));

Posting Permissions

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