Working with queries

A query is a pre-defined set of record filter and sort statements that you can define, modify and use in FlexMail. Each query is saved and attached to the currently active mailing list and can be recalled at any time. You can define an unlimited number of queries.

When you select a query through the Query list box, FlexMail filters out all the records except those matching the selection criteria defined for the query and sorts the matching records according to the sort specifications defined for the query. Note that records are only filtered out of the display, they are not deleted from your database. No data is lost as a result of the query.

The query feature controls what records FlexMail is to display and in what order. The default query is <All records> which displays every record in the currently opened database. Through FlexMail, however, you can define any number of alternate queries that:

Creating queries

FlexMail allows you to define a query by assigning a name to it and define a filter and sort that should be executed when the query is run. To make this process easy, FlexMail will assist you with the New Query wizard that takes you through the necessary steps of defining a query.

To define a query:

  1. On the Data Tools tab click Advanced in the Sort & Filter group. Then click Queries and New Query in the menu that appears.

    The New Query wizard opens.

  2. In the first step, enter a name and description for your query. If you want to base your new query on an existing one, select that query in the Copy values from list box. Click Next when you are finished.

  3. Define the filter for your query. To learn more about defining filters, see Advanced selections. Click Next proceed with the next page.

  4. Define the sort order for your query. To learn more about sorting, see Advanced sorts. Click Next when you have defined the ordering you want.

  5. Select the query properties you want in the he Query Properties page of the wizard:

    • Unique values only. Select this item to hide duplicate records in the data table. If two or more rows of data are identical, FlexMail will display only one of the rows.

    • Group records. Group the records on all fields in a record.

  6. Click Finish to save and apply the query.

Notes:

Back to top

Running a Query

You can run any query that is currently defined for the database that is linked to the project. Since queries are linked to a database and shared between users, you can also run queries created by other users in a multi-user environment.

To run a query:

-or-

FlexMail runs the selected query and displays all matching records. The active query will be displayed in bold in the FlexMail Workspace.

NOTE: If you run a query, it will remove all filters and sorts that are currently active. However, if a query is active, any filter you specify will work within the selection defined in the query.

Back to top

Modyfying a Query

To edit a query:

  1. On the Data Tools tab click Advanced in the Sort & Filter group. Then click Queries and select Edit for the Query you want to change.

    -or-

    In the FlexMail Workspace right-click on the query you want to edit and select Edit.

  2. Make any changes you want for the query. See Advanced sorts and Advanced selections for more information.

  3. Click Finish to save and apply the (modified) query.

Back to top

Deleting a query

To delete a query:

-or-

After deleting a query, FlexMail will display all records in the database in their original order.

Back to top