ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Query editor / Operations on queries
  • Overview
  • How to add a selection condition?
  • Adding a selection condition to a Select query
  • Adding a selection condition into an Update query or into a Delete query
  • How to modify a selection condition?
  • Modifying a selection condition in a select query
  • Modifying a selection condition in an update query or in a delete query
  • How to delete a selection condition?
  • Deleting a selection condition from a select query
  • Deleting a selection condition from an update query or from a delete query
  • Tip
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The selection conditions of records are applied to the items used in the queries. These conditions are used to select the records that match one or more specific criteria.
For example:
  • customers whose name starts with "C".
  • products whose price exceeds 500 Euros.
  • orders placed between "01/01/2000" and "06/01/2000".
  • ...
Several selection conditions can be defined for a single item.
The selection conditions are defined when creating the query. However, you have the ability to add, modify or delete the selection conditions used in a query. These operations are described in the following paragraphs.
When at least two selection conditions are found in a query, the sequence of the selection conditions must be specified. For more details, see Sequence of selection conditions.
How to add a selection condition?

Adding a selection condition to a Select query

To add a selection condition to a select query:
  1. On the "Query" tab, in the "Edit" group, click "Description". The query description window appears.
  2. In the middle section, select the item onto which the selection condition must be added.
  3. Click the "Selection condition" button and select "New condition". The wizard for creating a selection condition is displayed.
  4. Choose the selection criteria (equal to, greater than, ...) of the condition. This condition can be applied to a given value, a parameter, the records selected by another query, ... For a date item, the selection condition can be applied to a preset date (the current year, the current month, today).
    Remark: You have the ability to select a given value via Selection value. The following menu is displayed:
    Selection value
    You can:
    • select one of the possible values among the values found in the file
    • view the entire file.
      Caution: This option is available only if Live Data is enabled. For more details, see Live Data.
  5. Indicate (if necessary) a comment on the condition. This comment will be displayed in the SQL code of query (preceded by the "--" or "//" character). If the condition is applied to a parameter, during a GO of the query with parameters, the comment will be displayed in the window for entering parameters.
  6. Validate. The selection condition is automatically added to the query.

Adding a selection condition into an Update query or into a Delete query

To add a selection condition into an update query or into a delete query:
  1. On the "Query" tab, in the "Edit" group, click "Description". The query description window appears.
  2. Display the "Query" tab.
  3. Select the item onto which a selection condition must be added and click the "Condition" column corresponding to the selected item. The wizard for creating a selection condition is displayed.
  4. Select "I want to add a condition" (for an item onto which at least one condition is performed).
  5. Choose the selection criteria (equal to, greater than, ...) of the condition. This condition can be applied to a given value, a parameter, a subquery, etc.
  6. Indicate (if necessary) a comment on the condition. This comment will be displayed in the SQL code of query (preceded by the "--" or "//" character). If the condition is applied to a parameter, during a GO of the query with parameters, the comment will be displayed in the window for entering parameters.
  7. Validate. The selection condition is automatically added to the query.
How to modify a selection condition?

Modifying a selection condition in a select query

To modify a selection condition in a select query:
  1. On the "Query" tab, in the "Edit" group, click "Description". The query description window appears.
  2. In the middle section, select the item on which a condition must be modified.
  3. Click the "Selection condition" button and select "Modify the condition".
  4. Select (if necessary) the selection condition to modify (for an item on which several conditions are performed).
  5. Modify the selection condition.
  6. Validate. The selection condition is automatically modified.

Modifying a selection condition in an update query or in a delete query

To modify a selection condition in an update query or in a delete query:
  1. On the "Query" tab, in the "Edit" group, click "Description". The query description window appears.
  2. Display the "Query" tab.
  3. Select the item on which a condition must be modified and click the corresponding "Condition" column. The wizard for selection conditions is displayed.
  4. Select "Modify an existing condition".
  5. Select (if necessary) the selection condition to modify (for an item on which several conditions are performed).
  6. Modify the selection condition.
  7. Validate. The selection condition is automatically modified.
How to delete a selection condition?

Deleting a selection condition from a select query

To delete a selection condition from a select query:
  1. On the "Query" tab, in the "Edit" group, click "Description". The query description window appears.
  2. In the middle section, select the item from which a condition must be deleted.
  3. Click the "Selection condition" button and select "Delete a condition".
  4. Select (if necessary) the selection condition to delete (for an item on which several conditions are performed).
  5. Validate. The selection condition is automatically deleted from the query.

Deleting a selection condition from an update query or from a delete query

To delete a selection condition from an update query or from a delete query:
  1. On the "Query" tab, in the "Edit" group, click "Description". The query description window appears.
  2. Display the "Query" tab.
  3. Select the item for which a condition must be deleted and click the corresponding "Condition" column. The wizard for selection conditions is displayed.
  4. Select "Delete an existing condition".
  5. Select (if necessary) the selection condition to delete (for an item on which several conditions are performed).
  6. Validate. The selection condition is automatically deleted from the query.
Tip
To add, modify or delete a selection condition in a select query, click the condition column of the query items and select the operation to perform in the following menu:
Selection condition
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help