SQL select records NOT in both tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • iam247@gmail.com

    SQL select records NOT in both tables

    Hi

    I'm using Access 2002. I have 2 tables tblGroupContact ,
    tblGroupPermiss ion, both have 2 fields identical structure:

    ContactID GroupID (Both are Composite keys and both hold integers)

    tblGroupContact holds everybody and the groups they are members of.

    tblGroupPermiss ion holds only those people who have permission to make
    changes to another part of the DB.

    The SQL at the end of post works, but opens a dialogue box looking for
    a parameter value 'query1.Contact ID'

    Clicking enter or cancel (without entering anything) works OK.

    What have I done wrong to cause this parameter request.

    Thanks ColinK

    SELECT tblGroupContact .ContactID, tblGroupContact .GroupID
    FROM tblGroupContact LEFT JOIN tblGroupPermiss ion ON
    (tblGroupContac t.ContactID = tblGroupPermiss ion.ContactID) AND
    (tblGroupContac t.GroupID = tblGroupPermiss ion.GroupID)
    WHERE (((tblGroupPerm ission.ContactI ­D) Is Null) AND
    ((tblGroupPermi ssion.GroupID) Is Null));

  • Stu

    #2
    Re: SQL select records NOT in both tables

    Well, first, you're posting in the wrong group. This is a group for
    SQL Server; an Access forum might be more appropriate.

    Second, Microsoft Access is a little flaky when it comes to building
    queries using the SQL editor (go figure); you may want to cut and paste
    the text of the query you have built into a new query and see if that
    works.

    HTH,
    Stu

    Comment

    • iam247@gmail.com

      #3
      Re: SQL select records NOT in both tables

      Thanks for the direction - I did try an access forum but got no answers
      yet

      Comment

      • iam247@gmail.com

        #4
        Re: SQL select records NOT in both tables

        Hi

        I got no response from an access forum, but copying to a new query
        worked perfectly.

        Thanks

        ColinK

        Comment

        Working...