Results 1 to 3 of 3
  1. #1
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199

    Access combine or exclude two fields.

    Hello,

    Can anyone confirm or have other suggestions for how to run these two different queries, one combines on 2 fields and another excludes on 2 fields?

    Combine on 2 fields:



    SELECT [Combines on 2 fields - step 1].[Unique ID Field A], [Combines on 2 fields - step 1].[Unique ID Field B]FROM [Combines on 2 fields - step 1] LEFT JOIN [Table 2] ON [Combines on 2 fields - step 1].[Unique ID Field B] = [Table 2].[Unique ID Field B];


    Exclude on 2 fields:

    SELECT [Table 1].ID, [Table 1].[Unique ID Field A], [Table 1].[Unique ID Field B]FROM [Table 1] LEFT JOIN [Table 2] ON ([Table 1].[Unique ID Field B] = [Table 2].[Unique ID Field B]) AND ([Table 1].[Unique ID Field A] = [Table 2].[Unique ID Field A])
    WHERE ((([Table 1].[Unique ID Field B]) Is Null) AND (([Table 2].[Unique ID Field A]) Is Null));




    Attached Files Attached Files

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    How about an example of what these mean? And/or a clear description in simple English?

    combines on 2 fields

    Exclude on 2 fields

  3. #3
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    @orange,

    sorry for the confusion. Basically the "combine on 2 fields" mean that the query checks to see if either of 2 id fields match and if so than joins on those matches. "exclude on 2 fields" does the reverse - checks to see if 2 fields don't match and if not doesn't make those joins. Does that make sense?

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

Similar Threads

  1. Replies: 7
    Last Post: 05-20-2015, 09:59 AM
  2. Exclude data points where fields are equal
    By jysupert in forum Queries
    Replies: 1
    Last Post: 09-02-2014, 03:30 PM
  3. Replies: 3
    Last Post: 06-24-2014, 10:24 PM
  4. Replies: 7
    Last Post: 03-03-2014, 03:33 AM
  5. Replies: 3
    Last Post: 09-11-2011, 06:38 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