Results 1 to 4 of 4
  1. #1
    aflamin24 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jul 2012
    Posts
    7

    Return only records that match multiple conditios

    Below is a snippet of a query which I am running.



    These are two fields from a query that are related to hazardous material packages that I am tracking. What we have is a tracking number(so in this example there are two unique tracking numbers = 2 packages) and F3 which means if the package was scanned a certain way. I want to know of any package where all the F3 values are zero. There are hundreds of unique tracking numbers, but I just copied a couple to keep it simple.

    What method would I use to approach this?



    TrackingNumber F3
    2 1Z4519380355990662 0

    3 1Z4519380355990662 1

    4 1Z4519380355990662 1

    5 1ZW811R80342066082 0

    6 1ZW811R80342066082 0

    7 1ZW811R80342066082 0

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Given the sample data, this should work:

    SELECT TrackingNumber, Max(F3) AS MaxValue
    FROM Tablename
    GROUP BY TrackingNumber
    HAVING Max(F3) = 0
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aflamin24 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jul 2012
    Posts
    7
    Thanks Paul, this was much easier than I was making it out to be. I appreciate the example!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 14
    Last Post: 02-12-2012, 10:14 AM
  2. Replies: 5
    Last Post: 01-24-2012, 06:19 PM
  3. How does access match records?
    By johnmerlino in forum Access
    Replies: 4
    Last Post: 10-05-2010, 08:51 AM
  4. Dlookup to match two criteria and return value
    By randolphoralph in forum Programming
    Replies: 20
    Last Post: 05-20-2010, 12:27 PM
  5. Match Records between TableA and TableB
    By friskydingo in forum Queries
    Replies: 0
    Last Post: 12-03-2008, 09:17 AM

Tags for this Thread

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