Filtering with the QBE format

The criteria panel in the lower part of the Query Editor window is for you to filter out some unnecessary records in a query. This filter is in the format of Query by Example (QBE).

When filtering with the QBE format, you are prompted to type the search criteria into a template resembling the data record. The advantage of query-by-example retrieval is that you don't need to learn a query language to frame a query. All the data fields are shown to you, and all you need to do is to enter the information that restricts the search to the required criteria. Any fields left blank, however, will match everything.

The columns and menus allow you to specifically define criteria for the fields in JReport Designer. For example, if a field is labeled REGION, and this field is a list of all 50 states in the United States. If you only want to see information from California (CA) and New York (NY), in the criteria menu, you can pick out CA and NY by placing their names in the column as seen below.

You just need to type in NY and CA. JReport Designer automatically places the ='xx' (equal sign and quotes) in the column for you. Below is a list of the syntax available:

Note: In an Oracle database, if you want to use a Date or DateTime type parameter or a specific date or time to filter the fields of a query, you need to apply the to_date() or to_timestamp() function in the filter condition, for example: