Results 1 to 3 of 3
  1. #1
    Nanuaraq is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    77

    Constructing query with a search criteria for one column based on what is found in another column.

    I am doing a survey of agents on a particular market.


    I have comprehensive data about who delivers to who. Several of the receivers may also act as suppliers to others. Like, agent A delivers to agent C, agent B delivers to agent C, agent C delivers to agent D, and so on.
    They are in a table like this:
    Supplier.Receiver
    A..........C
    B..........C
    C..........D

    I am trying to find out which of the receivers that do not act as supplier to anyone else. In the example above, I am looking for D because D is not anywhere in the column "Supplier". I am neither looking for A, B nor C.
    D has the characteristic that it is not found in the column "Supplier" and so it ought to be possible to do a query that shows me this extract of the table above:
    Supplier.Receiver
    C..........D

    How to do?
    Thank you in advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Consider:

    SELECT Table1_1.Supplier, Table1_1.Receiver
    FROM Table1 AS Table1_1 LEFT JOIN Table1 ON Table1_1.Receiver = Table1.Supplier
    WHERE (((Table1.Supplier) Is Null));
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Nanuaraq is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    77
    Quote Originally Posted by June7 View Post
    Consider:

    SELECT Table1_1.Supplier, Table1_1.Receiver
    FROM Table1 AS Table1_1 LEFT JOIN Table1 ON Table1_1.Receiver = Table1.Supplier
    WHERE (((Table1.Supplier) Is Null));
    Boy, I have no idea how this worked, but it did!
    Thank you, this came in handy.

    Ultimately, it turned out the resulting picture of companies and their relations were so arbitrary that no useful data cuold be obtained, but not it's tested.

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

Similar Threads

  1. Criteria based on column title
    By Akcess in forum Access
    Replies: 2
    Last Post: 06-30-2016, 07:04 AM
  2. Replies: 4
    Last Post: 12-29-2015, 03:25 PM
  3. Sum a column based on two criteria.
    By Degs29 in forum Queries
    Replies: 3
    Last Post: 09-24-2014, 02:32 PM
  4. Replies: 5
    Last Post: 05-01-2013, 11:39 AM
  5. Replies: 1
    Last Post: 04-15-2010, 02:07 AM

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