Results 1 to 2 of 2
  1. #1
    avarusbrightfyre is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Sep 2009
    Posts
    60

    "Not" criteria works for one line, but not two

    As the title states, I am unable to use a Not "this" statement in my query criteria for more than one item.

    My specific problem is I'm trying to do this:

    Date Organization Event
    >Date() Not "This" Not "This"
    >Date() Not "This" Not "This"

    If I do just one "not" criteria for each item, it works fine, but doing it for both doesn't work for either. If I put them both in the same line using an "or" between the values I don't want, it works for one but not the other.
    I tried creating a new query to rule out any corruptions, but it still does the same thing.



    What is the proper procedure for exluding multiple text values from a field and showing all the others? The program automatically converted my "Not" to "<>" when I reloaded the program, so I've already tried using that.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    For Text you would use <> and if you want an OR (it is greater than the current date AND Org doesn't equal "This" OR the date is greater than the current date AND Event doesn't equal "This" would be:

    Code:
      Date         Organization           Event
    >Date()        <> "This" 
    >Date()                              <> "This"
    If you want the date to be greater than the current date And Org AND Event to not be equal to "This" then it would be a single line:
    Code:
      Date         Organization             Event
    >Date()        <> "This"               <> "This"
    Now, one thing to be wary of. Using DATE as a field name or object name is not good. That is an Access Reserved Word and it may come back and bite you at the most inopportune times. I would not use it as a name.

    Oh, and make sure you know that >Date() means it would be TOMORROW or Greater. It does not include today.

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

Similar Threads

  1. 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
  2. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  3. Replies: 2
    Last Post: 05-17-2011, 02:40 PM
  4. Replies: 5
    Last Post: 12-06-2010, 10:15 AM
  5. Replies: 1
    Last Post: 10-19-2009, 02:37 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