Show TOC

Object documentationQuery Wizard: Conditions and Relations Locate this document in the navigation structure

 

Use the Display Conditions and Display Relations tabs in the Conditions and Relations step to define the conditions and relations for retrieving data. Both conditions and relations are based on the database structure and logic.

Display Conditions Tab
Brackets Columns ( )

Define the priority sequence of the conditions.

Click these columns to select the appropriate bracket type.

Table

Click this column to select the table for which you want to set conditions.

Field

Press Tab to select the required field from the selected table, for which you want to set conditions.

Condition

Click this column to choose the required condition: Equal, Greater than, Smaller than, Not equal, Contains, and so on.

The following terms also appear on the list:

  • IS NULL – the field on which you apply the condition is blank

  • IS NOT NULL – the field on which you apply the condition contains a certain value

Example Example

If no value was entered in the Customer/Supplier Ref. No. field in a marketing document, the value of that field is NULL.

End of the example.
Table

Click this column to select an additional table. This enables you to:

  • Create a condition that combines two different tables (optional)

  • Compare one field to another in the same table

Field/Value

The following alternatives can be defined in this column:

  • Field from a table – enabled only if a table was entered in the Table column

  • Fixed value – any fixed data, such as string or number

  • Variable – enter the string [%0] to create a query that first displays a field for entering a value, and then runs

    Note Note

    Each variable is unique. Therefore, if you have to define more than one variable, you should name them as follows: [%0], [%1], [%2]...

    End of the note.
And/Or

This column enables you to define complex conditions, by defining the relationship between two or more conditions that you define.

  • AND – retrieves records that comply with all the conditions linked by the AND operator

  • OR – retrieves records that comply with at least one of the conditions linked by the OR operator

Display Relations Tab
Execute

Applies the defined relation between the tables that appear in the row.

When this checkbox is selected, SAP Business One adds another condition. This means that the records you want to retrieve must comply with the conditions defined on the Define Conditions tab and with the added condition.

From Table

Select the checkbox All to display data from the table that appears in the To Table section of the query results.

To Table

Select the checkbox All to display data from the table that appears in the From Table section of the query results.

More Information

Query Wizard