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:
Display a selection of records from your mailing list.
Display records sorted according to the value in a specific field.
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:
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.
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.
Define the filter for your query. To learn more about defining filters, see Advanced selections. Click Next proceed with the next page.
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.
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.
Click Finish to save and apply the query.
Each query is saved and attached to the currently active mailing list and can be recalled at any time.
If you open a query to make changes and someone else modifies the query design before you have finished, FlexMail displays a message telling you that the query has changed since you started working. You can either replace the new changes with your changes or save your version of the query with a different name. If others are using the query to view data while you're changing the design, they don't see the design changes until they close and reopen the 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:
On the Data Tools tab click Advanced in the Sort & Filter group. Then click Queries and select Load for the Query you want to activate.
-or-
Click the Query you want to activate in the FlexMail Workspace.
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.
To edit a query:
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.
Make any changes you want for the query. See Advanced sorts and Advanced selections for more information.
Click Finish to save and apply the (modified) query.
To delete a query:
On the Data Tools tab click Advanced in the Sort & Filter group. Then click Queries and select Delete for the Query you want to activate.
-or-
In the FlexMail Workspace right-click on the query you want to delete and select Delete.
After deleting a query, FlexMail will display all records in the database in their original order.