Show TOC

Object documentationSyntax for Defining a Query Locate this document in the navigation structure

 

The rules of syntax for defining queries are the same for both simple and complex queries, and must be followed.

  • A query condition appears only once in the query definition and always begins with IF.

  • Every other condition is performed on the corresponding field, even if the field already appears previously in the definition.

  • If you define a condition with the item number, and you want to add another condition for the item number, it would follow this example: The definition would start with IF ItemCode INCLUDES computer, and would continue with AND ItemCode INCLUDES package.

  • When you enter a value range for a condition, you must enclose it in square brackets. Two periods separate the lower limit from the upper limit. To define multiple value ranges, separate them with a comma. For example:

    IF ItemDescription IN_RANGE [a .. bank, c .. jar]

  • When you define several consecutive conditions, they are handled just like mathematical operations.

    • Use parentheses if you want to define a specific sequence for the query.

    • Enclose the conditions that you want to process first in parentheses, just like you would for mathematical operations.

    • The system processes the conditions in parentheses first, followed by the other conditions.

  • AND conditions always have priority over OR conditions.

Note Note

The fields that will be displayed in the query always appear before the query conditions and are, therefore, written to the left of the conditions.

If you want to add another field to the display after you have defined the conditions, you have to insert the field to the left of the conditions. To do so, either drag the field to the appropriate position, or position the cursor in the appropriate place and double-click the field in the data column.

End of the note.