Microsoft KB Archive/307922

= OL: How to Use the Query Builder for View Filters and Advanced Searches =

Article ID: 307922

Article Last Modified on 11/14/2003

-

APPLIES TO


 * Microsoft Outlook 2002 Standard Edition
 * Microsoft Outlook 2000 Standard Edition
 * Microsoft Outlook 98 Standard Edition

-



This article was previously published under Q307922



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SUMMARY
This article discusses how to configure and use the Query Builder tool to create more advanced view filters and search criteria in Outlook 2002, Outlook 2000, and Outlook 98.



MORE INFORMATION
Query Builder is a feature available in Microsoft Outlook 98, Microsoft Outlook 2000, and Outlook 2002. Query Builder lets you define more complex criteria when you create a filter for a folder view or do an advanced search. The Query Builder also provides a more intuitive interface for users to configure filter or search criteria. When it is in use, Query Builder appears as a tab in the Advanced Find and Filter dialog boxes.

How to Turn On Query Builder
To turn on the Query Builder, add the QueryBuilder key to the registry.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

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: Outlook 98

HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Outlook

Outlook 2002

HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook

 On the Edit menu, click New, click Key, and then type QueryBuilder for the key name. Quit Registry Editor.</li></ol>

How to Use Query Builder
The main purpose of the Query Builder tool is to provide more complex filters and search criteria than are normally possible with the options in the Filter and Advanced Find dialog boxes. For example, if you use the Advanced tab to do a query that has two entries that use the SAME field, the result is an OR condition:

To: contains  

To: contains  

This query returns any item that contains   or   in the To: line of an e-mail message. Although this method is not very intuitive, you can make this an AND query by entering the condition with the strings separated by a space, as shown:

To: contains  

In Query Builder, this type of AND query can be done much more intuitively by adding the same field multiple times. Query Builder automatically generates an AND query. You can easily change this query to an OR query by selecting the appropriate value in the Logical Group list.

The following query is another example of a query that you can do only with Query Builder:

Subject is not empty

Subject does not contain  

This criteria will return all items where the Subject field contains data AND Subject does not contain the string specified by  .

How to Create Nested Conditions
With Query Builder, you can create nested conditions by using the Move Up and Move Down buttons. After you have added three or more fields to the criteria list, you can use the buttons to move the selected line up or down to create a nested condition. Nested conditions allow for much greater complexity and a finer level of control over the criteria.

Additional query words: olxp

Keywords: kbinfo KB307922

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.