Results 1 to 2 of 2
  1. #1
    shoelesscraig is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Posts
    53

    Query Criteria Question

    I've searched for this a thousand ways, but still can't find what I'm looking for. But, I'm sure I'm missing it (or not realizing that there is a better way to do what I want)...so I apologize ahead of time.

    In a query "criteria" box, I'd like to do something like use an IIf statement, and say that: If "x" is true, then the criteria is "y", but if "x" is false, then act as if the criteria box is completely blank (return all records for that particular column). I've tried using Null, but that obviously doesn't mean what I though it did. I tried putting " " in there, but it doesn't like that either.



    What am I doing wrong? I'm sure it's something basic I'm not realizing...

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    always helps to provide a bit of the sql to put into context. best guess at what you want would be something like

    WHERE (x=true and somevalue=y ) or x=false

    or slightly shorter

    WHERE (x and somevalue=y ) or not x

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

Similar Threads

  1. Replies: 5
    Last Post: 06-13-2015, 04:29 PM
  2. Criteria Query Question !
    By Guy Winfield in forum Access
    Replies: 5
    Last Post: 05-15-2015, 09:41 AM
  3. Query Criteria Question
    By RayMilhon in forum Queries
    Replies: 5
    Last Post: 06-28-2013, 10:49 AM
  4. query criteria question
    By damos2001 in forum Queries
    Replies: 3
    Last Post: 04-06-2013, 03:20 PM
  5. Query Criteria Question
    By jrockusa in forum Queries
    Replies: 0
    Last Post: 11-13-2009, 09:16 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