#### Filtering with the filter format

Compared with QBE, the filter provides you with more flexibility with entering your conditions. The expression includes not only the DBField selected, but also formulas and parameters. You can also manually type in strings that are supported by the database.

To filter with the filter format, select Filter from the Query menu to bring out the Search Condition dialog. See the dialog.

Specifying expressions:

The expressions are the main section of the filter. To place a criterion, follow the steps below:

1. Click the Add Condition button to add a condition line.
2. In the field text box, specify the field to be filtered. You can either type in the name of the field manually or click to specify the field in the Expressions dialog.
3. From the operator drop-down list, select an operator as required.
4. In the value text box, type the value of how to filter the field manually or click to specify the value in the Expressions dialog.
5. If you want to add more conditions, click the Add Condition button, define the conditions and then set the relationship between the condition lines as required.
6. When done, click OK to accept the settings.

Notes:

- The symbols at the bottom of the Expressions dialog allow you to modify the expression according to your requirements.
- In addition to setting the condition value by selecting from the Field Value tab, you can also type the value in the Expression text box. If the value is of String type, it should be as 'aaa' with a quote mark. The quote mark can be typed by yourself or be added by JReport Designer automatically. To have the quote mark automatically added by JReport Designer, follow the steps below:
  1. Click the Options button on the Catalog Browser toolbar.
  2. In the Options dialog, switch to the Query Editor category and check Automatically add quotation marks on table and column names.
  3. Click OK to save the settings.
- When you specify the value of a filter condition, you can use sub-queries to narrow down the result with the second tab Subquery in the Expressions dialog (see Using sub-queries in filters).

See also:

- Search Condition dialog for detailed explanation about options in the dialog.
- Dynamically filtering queries for additional information about how parameters can be used to filter queries dynamically.