Selecting by condition

Navigation:  Mail merge > Selecting records for a mail merge >

Selecting by condition

Previous pageReturn to chapter overviewNext page

Note: If the database module is not displayed, open it with the ribbon command Mailings | group Recipients | Select recipients.

In the group Records in the database module, you can use the command Select db_select_records_icon | By condition to make a selection based on a condition – for example, "Select all those that have 'Smith' in the Name1 field". All records that fulfill this condition will then be included in the selection.

Tip: It is necessary only for the content of the field to begin with the search term. If the content of the field Name1 in a record is "Smithson", Write also selects this record.

You can also combine several conditions – for example, Name1=Smith and City=London to select all Smiths living in London.

If you choose the command Select db_select_records_icon | By condition, the following dialog box appears:

db_select_condition_dialog

For example, to select all records where the Name1 field begins with "Smith", proceed as follows:

1.In the dropdown list Database field, select the desired field – thus Name1 in the above example.
2.In the Content input field, enter the value for which you want to search – thus "Smith" in the above example.

Note: The search is case-sensitive. When searching for "Smith", records with "SMITH" or "smith" are not found.

3.Click on the Add button to define the condition, which is then entered in the list Conditions.
You could now add more conditions by repeating the above steps.
4.Click on Select to add all records that fulfill the condition to the selection. Alternatively, click on Deselect to remove these records from the selection.

If you now click on Select, all data records will be added to the selection where the field Name1 starts with "Smith".

You can use the Delete and Delete all buttons in the above dialog box to delete previously added selection conditions at any time if they are no longer needed.

Note: Bear in mind that once data records have been selected, they remain selected until they are explicitly deselected. Thus, if you select by Name1=Smith and then by Name1=Brown, all Smiths and all Browns will be selected. If you really only want to write to the Browns, you must first deselect all records before applying the condition Name1=Brown by selecting the ribbon command Select | Deselect all records.

Available logical operators

In addition to the equal sign =, you can also use other logical operators for conditions in the above dialog box. The following operators are available (in the dropdown list to the right of the field name):

Operator

Explanation

=

The field for which the search was performed must contain a term that is identical to the search term or a term that at least starts with it.

<>

The field for which the search was performed must not contain a term that is identical to the search term or a term that at least starts with it.

<

Less than (for use with numeric fields)

>

Greater than (for use with numeric fields)

<=

Less than or equal to (for use with numeric fields)

>=

Greater than or equal to (for use with numeric fields)

contains

The field for which the search was performed must contain the search term at any position.

If the condition Name1 contains Smith, the program will select all records for which this field contains the contents "Smith", "Smithson" or "Jones, Smith & Co.", for example.

is empty

The field for which the search was performed has no entry.