Primary Criteria in Query Forms

On the Primary Criteria tab of a query form, you can specify query criteria for the principal fields on the associated multiview form. Usually these fields represent only the two or three most commonly searched criteria for the form. For example, in a form used to maintain information about customers, primary fields might include customer identification number and customer name.

The same fields are also listed on the Additional Criteria tab. This means that query criteria for the principal fields can be specified on either tab.

Primary criteria consist of an operator for the selected field on which you want to filter data and a value for the field. By default, the comparison operator for all primary criteria is like, and the values are empty. With these settings, all records are considered a match. The result set is the same as the result set from executing Filter-in-Place when no values are entered in fields on the form.

Primary criteria are automatically joined by a Boolean AND. That is, records are retrieved from the database only if they meet all the specified criteria.

To specify primary criteria for a query:

  1. In a query form, select the Primary Criteria tab.
  2. For a field on which you want to filter, from the drop-down list, select an operator.

    For more information about operators, see Operators on Query Forms.

  3. Enter a value for the field.

    Remember that you can use wildcards in your search.For more information, Using Wildcard Characters.

  4. To find records that contain a null value in the field, you can also enter the Null keyword.

    For more information, see Using the Null Keyword.

  5. To find records compared to the current date, you can use the CURDATE() keyword. See Sample Queries for more information.

    Alphabetic input is not case-sensitive.

  6. To filter on more than one field, repeat steps 2 and 3.
  7. To perform the query and return the results, click Refresh.

Example

Suppose that you own a company that deals primarily with bicycle retailers. You want to retrieve all records that contain "bi" in the Name field, so that you will get a collection displaying all records that contain either "bike" or "bicycle."

Notice that, in the figure below, the operator for the Name field is like, which is the default.

The value *bi* restricts the results to those records containing "bi" in the Name field. The wildcard character (*) matches all other possible combinations of characters that come either before or after the search value "bi". Because no value is specified for the Customer field, that field can contain any value. As a result, the query might return records containing "Bicycle Center" and "Terry's Bike Shop" in the Name field.

NOTE:

Related Topics

About Query Forms

Additional Criteria in Query Forms

Buttons on Query Forms

Finding Records Using a Query Form

Operators on Query Forms

Sample Queries

Using Wildcard Characters

Using the Null Keyword