Results 1 to 3 of 3
  1. #1
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317

    Filtering out rows based on values in other rows

    Folks



    I'm in a state of conceptual befuddlement over what I'm sure must be the simplest issue in the world.

    In the query pictured in the attached image entitled 'DatasheetView', I want to filter out all rows where there's a DocumentID (first column) that has at least one tick against it under OriginatingOriginated (fifth column). So all occurrences of DocumentID 45 would be filtered out, as there's a tick against it in the first row in which it occurs, and all occurrences of DocumentID 47 would be kept in, as there are no ticks against it in any of the rows in which it occurs.

    I've tried using DCOUNT in various ways, but only with the result of filtering out every row in whole datasheet. Help!

    Remster

  2. #2
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,043
    Hi,

    create a query like : select distinct DocumentId where Originated = true.

    Than link that query with an outer join and an 'Is Null' criterion or use it as a subquery to find out all records in query 1 without a related record in query 2

    gr
    NG

  3. #3
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    Thanks, that makes sense.

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

Similar Threads

  1. Replies: 6
    Last Post: 07-21-2011, 04:51 AM
  2. Replies: 1
    Last Post: 06-12-2011, 07:08 AM
  3. Insert x number of rows based on value
    By opopanax666 in forum Programming
    Replies: 4
    Last Post: 10-26-2010, 03:26 AM
  4. Crushing Rows
    By SCFM in forum Access
    Replies: 4
    Last Post: 03-02-2010, 09:10 AM
  5. Queries the max from two rows
    By mohsin74 in forum Queries
    Replies: 0
    Last Post: 12-15-2006, 12:52 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