Results 1 to 7 of 7
  1. #1
    mcgarr423 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2016
    Posts
    10

    Criteria "Not this or that"

    Trying to modify a query to eliminated records with their status field being "Cancelled" and eliminate records with status "Completed"

    The status field is a lookup with a set list of values, one being Cancelled and one Completed. I want those records to be omitted when this query is run.

  2. #2
    mcgarr423 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2016
    Posts
    10
    Should I be creating two queries? The first eliminating cancelled and then the second eliminating completed?

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    And's and Or's tend to get a bit confusing when combined with "Not". You can use : Not In("Cancelled","Completed"). Another way is : <>"Cancelled" And <>"Completed".

  4. #4
    mcgarr423 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2016
    Posts
    10
    Thank you! My workaround for the time being was Not Like "C????????"

    I thought it was a funny solution, both values just happen to start with the same letter and have the same # of characters... but that would confuse the hell out of people working on the database in the future haha

  5. #5
    mcgarr423 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2016
    Posts
    10
    Follow up... is there a way to omit "cancelled" and "completed" without also eliminating all records with that field Null? when using Not In("Cancelled","Completed") it seems to equate to not "completed", "cancelled", Null.

    I have a default value for status now, but a lot of previous entries have a blank status field.

  6. #6
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Try:
    Code:
    Is Null Or Not In ("Cancelled","Completed")

  7. #7
    mcgarr423 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2016
    Posts
    10
    That did the trick, thank you

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

Similar Threads

  1. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  2. Replies: 4
    Last Post: 08-26-2014, 05:52 PM
  3. Replies: 13
    Last Post: 06-23-2014, 01:07 PM
  4. Replies: 3
    Last Post: 12-17-2013, 08:27 AM
  5. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 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