Table-Exclusion Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • isoquin
    New Member
    • Jul 2007
    • 48

    Table-Exclusion Query

    I've looked around and found things similar but not exactly this. I essentially have two lists.
    tbl_allData has every ID
    tbl_completedFo rm is a subset list of allData

    I would like a query [remainingList] to give me all IDs from tbl_allData except for those IDs found in tbl_completedFo rm.

    I know this should be simble, but I've tried all manner of SQL statements, joins, and <> to do this, with no luck. It'd be easy enough if I just wanted it to be WHERE ID <> (some specific value). I just don't know how to get it so that it displays every ID that doens't equal any other ID in another list.

    I am very grateful for help, as always.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hi, isoquin.

    Looks like you didn't try "all manner of SQL statements, joins, and <>" though.

    [code=sql]
    SELECT tbl_allData.* FROM tbl_allData LEFT JOIN tbl_completedFo rm ON tbl_allData.ID = tbl_completedFo rm.ID WHERE tbl_completedFo rm.ID Is Null;
    [/code]

    Regards,
    Fish

    Comment

    • jaxjagfan
      Recognized Expert Contributor
      • Dec 2007
      • 254

      #3
      Did you try the "Find Unmatched Query" wizard when you select new query. It would set the criteria for the ID of "tblCompletedfo rm" to null in the join.

      Comment

      • isoquin
        New Member
        • Jul 2007
        • 48

        #4
        ah i meant all manner of JOIN statements (left join, inner join, etc). thanks for the answer!

        Comment

        Working...