Is there any way I can specify AND and OR operators when using Advanced Find or creating more complex custom Views or Search Folders?
Many complex searches and filters can already be done on the Advanced tab of Advanced Find when searching for an item or creating a Search Folder or within the Filter section when creating a custom view. However, you’ll find that when you specify multiple values for the same field, it will use the OR operator and when adding another field, it will use the AND operator. This sometimes leads to unexpected results or not being able to execute some queries.
For instance, say that you want to find a specific email related to a certain project. Some emails you’ve already assigned the Project1 category so you want those to be included in your search results either way. Then, in order to find the rest, you specify people you’ve worked with in the project and several words that are related to the project.
So this query requires;
- an OR operator when specifying the names
(as they could be or from person A or from person B or from person C or to person A, or to Person B or to person C)
- an OR operator when specifying the words
- an AND operator for the combination of persons and words
- an OR operator between the project category and the combination of results specified at point 3.
You cannot do this with the option that you find on the Advanced tab.
In order to still achieve the desired results, you can enable the Query Builder which does allow you to control the AND and OR relation in your searches (yes, even nesting!). Enabling it needs to be done via the registry though;
- Open the registry editor;
Windows Vista: Start-> type; regedit
Windows XP: Start-> Run-> type; regedit
- Browse to the following location in the registry
- Choose: Edit-> New Key
- Name the key: QueryBuilder
When you now open any search or filter dialog in Outlook, you’ll also have a Query Builder tab. It works similar to the Advanced tab but now you are in control over the AND and OR operators and you can group and nest sub queries together to get the results you need.
The Query Builder tab in Advanced Find