none
Compound condition in search folder criteria

    Question

  • I am creating a search folder in Outlook 2010 and would like to replicate criteria that work fine using instant search. I have the following criteria, which return to correct results in instant search:

    • "Text val1" AND ("Text Val2" OR "Text Val3")

    When I use the same criteria when defining a search folder I get no return results. If I remove the parentheses and use the following criteria I get records:

    • "Text val1" AND "Text Val2" OR "Text Val3"

    But (as expected) the logical results aren't what I want. I'm getting results for the first two conditions AND'd as well as all messages that have the third condition. Is there some other way to force precedence using a search folder?

    Wednesday, September 19, 2012 1:43 PM

Answers

  • Hi,

    Outlook has a hidden feature, QueryBuilder, which can be very useful for those of you who need to define complex criteria for Search Folders or Advanced Find.

    To add the QueryBuilder key to the registry, follow these steps:

      • Quit Outlook.
      • Click Start, and then click Run.
      • In the Open box, type regedit,and then click OK.
      • Locate the following key in the registry based on your installed version: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook
      • On the Edit menu, click New, click Key, and then type QueryBuilder for the key name.
      • Quit Registry Editor.
      • Restart Outlook.

    Then choose the Filed first, click Add to List button. Then choose AND/ OR in the Logical Group.


    Jaynet Zhang

    TechNet Community Support

    • Marked as answer by Jaynet Zhang Friday, September 21, 2012 1:40 AM
    Thursday, September 20, 2012 5:52 AM
  • Excellent, thank you so much. That worked exactly as needed.
    • Marked as answer by ettobias Thursday, September 20, 2012 1:57 PM
    Thursday, September 20, 2012 1:57 PM

All replies

  • Hi,

    Outlook has a hidden feature, QueryBuilder, which can be very useful for those of you who need to define complex criteria for Search Folders or Advanced Find.

    To add the QueryBuilder key to the registry, follow these steps:

      • Quit Outlook.
      • Click Start, and then click Run.
      • In the Open box, type regedit,and then click OK.
      • Locate the following key in the registry based on your installed version: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook
      • On the Edit menu, click New, click Key, and then type QueryBuilder for the key name.
      • Quit Registry Editor.
      • Restart Outlook.

    Then choose the Filed first, click Add to List button. Then choose AND/ OR in the Logical Group.


    Jaynet Zhang

    TechNet Community Support

    • Marked as answer by Jaynet Zhang Friday, September 21, 2012 1:40 AM
    Thursday, September 20, 2012 5:52 AM
  • Excellent, thank you so much. That worked exactly as needed.
    • Marked as answer by ettobias Thursday, September 20, 2012 1:57 PM
    Thursday, September 20, 2012 1:57 PM
  • Wow, such an awesome feature!  I was beating my head on the desk, trying to make a Search Folder that would only show me "Unread E-Mail".  This wasn't a problem till I started using Outlook as my main RSS Client, and the default "Unread Mail" folder also included all unread RSS items.  Making a search folder that ignored Message Class containing RSS was easy enough, but then all my Deleted Items and Junk E-mail items where added to the count...trying to get all 3 conditions without the Query Builder might not have even been possible, but with the Query Builder it took me 90 seconds and is doing exactly what I wanted!


    Friday, March 21, 2014 2:42 AM
  • Brilliant!  :-D
    Wednesday, March 25, 2015 4:36 PM
  • WHY are we not funding this?!
    Wednesday, February 10, 2016 12:22 PM
  • Before I saw this thread I was trying to figure this out too. I had created individual search folders based on categories, but I wanted one that was essentially "none of the above". I found that I could create a criteria under advanced that was

    Categories | doesn't contain | category1 .or. category2 .or. category3

    and it worked.

    I'm still going to do this registry hack. But simply using ".or." as a separator and logic condition works too.

    Friday, January 26, 2018 11:26 PM