Mail List Queries

You can download quick reference information for Creating a Query by clicking on the icon

Flash ScreenCast

MP4 ScreenCast

Creating the query requires some planning and foresight. To start, you must decide what criteria you want the patrons to meet. If you are looking for very specific patrons, you must know what makes them unique from the rest. You may also narrow down your search by removing certain data from a returned query.

Creating a Database Query

You can download quick reference information for Creating a Query by clicking on the icon

Flash ScreenCast

MP4 ScreenCast

Creating the query requires some planning and foresight. To start, you must decide what criteria you want the patrons to meet. If you are looking for very specific patrons, you must know what makes them unique from the rest. You may also narrow down your search by removing certain data from a returned query. Click Here for information on complex criteria.

To create a Query, you would perform the following steps:

  1. Open the Mail List Window.

    Click Here to learn how.

  2. Click the New button.

    The Mail List Criteria window opens. For an overview of this window click here. A new Mail List is created and forms the base on which the database is queried.

  3. Enter a name for the new list.

    Make this a short descriptive name for quick reference.

  4. Enter a description of the mail list.

    This is especially important for other users who may use the mail list. A clear description of the criteria can be used to decipher the name of the list.

  5. Click the Save button.

    You can now enter the Criteria.

  6. Click the Criteria Tab.

  7. Click the Create Group button.
  8. Choose To Add Patrons To The Mail List.

    The following window opens.

    Select a file that contains the data you are searching for. As the example list is searching for patrons who have made donations of time or money; the two files to use would be "Volunteer Activity History For Patron" and "Donation Data For a Patron With Each Gift". Click for more information on selecting the file.

  9. Select the "Volunteer Activity History For Patron" file first.
  10. Click the Next button.

    The Parameter window opens.

    Click here for more information on this window. This is the interface through which code is added to perform a query on the database.

  11. Click the New button.

    The Add/Edit Parameter window opens.

    The list contains all the possible searchable fields available in your selected file. The selections on the top left side of the window (and, or, not) are used for searching multiple fields when more then one line of criteria is added within the same file. Click Here for an overview of conditions and search criteria.

  12. Select the field to search.

    For this example "Activity Hours Worked ", found under Volunteer Activity History For Patron, will be the selected search field criteria.

  13. Select a condition and set the parameters of the search.

    The condition displayed above will find any patron who has a value greater than zero under the "Activity Hours Worked" field.

  14. Click either:
    1. Add / Continue if adding another search criteria to the file.

      The Criteria window remains open until save or cancel is clicked.

    2. Save if the search criteria for this file is complete.

      The Parameter window will return and the entered criteria will appear in the list.

  15. Click the Done button.

    Now the group and its criteria have been added to the main query. For this example, another group needs to be added to include the patrons who have donated money.

  16. Click the Create Group button.
  17. Choose To Add Patrons To The Mail List.

    Choose a file containing the required data. This example requires the "Donation Data For a Patron With Each Gift" file.

  18. Click the Next button.
  19. Click the New button in the Parameters window.

    In the Edit/Add Parameters window, eave the And button selected. The field for this example would be "Donation Amount-Actual", found under Donation Data for a Patron With Each Gift, while the condition and parameter would be greater than zero,as the search is for any donation with a dollar value.

  20. Click the Save button.
  21. Click the Done button.

    Both of the Search Criteria are added to the query. The group criteria says add any patron who has volunteered their time as well as any patron who has made a donation to the list. Now, all the criteria have been added to satisfy the description, the database can be searched.

  22. Click the Execute button to begin the Query.

    The patrons satisfying the first criteria will be found and added to the list. Once complete, the second criteria will be performed and any patrons matching the second criteria will be added. Any patron matching both criteria will only be displayed once. The Mail List will default to the Who's In tab displaying all patrons who match the criteria and are in the list.

Complex Query Criteria

If you are designing a very specific mail list you will need to use some complex criteria to ensure you receive the desired data. Complex criteria uses brackets combined with operators and conditions to find specific groups of data. Click Here to view the different types of operators and conditions along with a description of their function.

Mail Lists - Rebuilding a Mail List

After creating mail list criteria and building the mail list, over time some of the patrons on the mail list may no longer meet the criteria to belong to the mail list. The most effective way to remove the patron that no longer meet the criteria is to rebuild the list.

  1. Open the Mail List Window.

    Click Here to learn how to access this window.

  2. Find the mail list you would like to rebuild.
  3. Click the Execute button.

    The following warning screen will open.

  4. Click the Rebuild button.
  5. Click the Yes button.

    This will remove the current patrons from the list and perform the query again on the new data. Clicking Proceed would have left all current patrons in the list, added patrons who fit the entered criteria and only remove patrons who fit within any "remove" criteria.

Parameters for Mail Lists Window

Parts of the Criteria for Group from Mailing List Window

Default search or sort order for the selected Parameters.
Inserts the last used criteria for the merge field selected.
Displays saved criteria options within the selected merge field.
Saves selected criteria.
Saves the entered criteria to be used again.
Opens the criteria window to insert new criteria.
Opens the criteria window and allow for modifications.
Removes the selected line of criteria.
Removes all lines of criteria in the parameters window.
Inserts brackets around lines of criteria.
Removes brackets around lines of criteria.
Searches the database for patrons who "have" a specified line of criteria. Having criteria is criteria that is based on aggrigate values within the search. Click here for more information on using Having.
Cancels the entry of criteria.
Completes the entry of criteria.

Having Criteria

The Having button allows you to add the having criteria to the search. Having criteria is criteria based on aggrigate values within the search.

  1. Open the Mail List you want to add the criteria to.

    The Mail List Criteria window opens.

  2. Click the Criteria Groups tab.

  3. Click the create Group button.

  4. Make your selection to Add or Remove Patrons from the listing.

    The Mail List dialog opens.

  5. Select the file for the primary source of information for your list. Then click the Next button.

    The Parameters window opens.

  6. Click the Having button.

    The Edit Report Parameters window opens.

    Note the criteria for selection on the left side of the window gives yous different options to choose from.

  7. Make your selections for the Criteria, and when complete, click the Save button.

    You are returned to the Parameters window and your criteria selection appears in the search.

  8. Click the Done button.

    You are returned to the Mail List window.

  9. Click the Execute to execute your search.

Removing Patrons Through a Query

If you wish to remove a large number of patrons from a list and they all have a common feature, using a query is the best technique. It is the same procedure as adding a new group except for selecting the Remove function. To ensure that you are removing the correct patrons, place the remove criteria group as the last group to be performed. Click here to learn how to rearrange groups.

  1. Open the Mail List Window.

    Click Here to learn how to open the window.

  2. Find the mail list from which you wish to remove patrons.
  3. Click the Criteria tab.

    A window with all existing criteria will appear.

  4. Click the Create Group button.
  5. Choose To Remove Patrons From The Mail List.

    The following window will appear.

    Select a file which contains data all patrons to be removed from the list have in common. Using the Example List created in Adding Patrons to a Mail List Through a Database Query patrons with last names starting with the letter A will be removed. The "Patron Data" file will be used for this example.

  6. Select "Patron Data" from the drop-down list and click the Next button.

    The Parameters window will open.

    Click Here for a detailed description of the window.

  7. Click the New Button.

    The Add/Edit Parameters window will open.

  8. Select the field to search by.

    For this Example the "Patron Name-Last " field.

  9. Fill the search parameters with the information to search by.

    For the example use "begins with A".

  10. Click the Save button.

    The Parameters window will return and the selected criteria will appear in the window.

  11. Click the Done button.

    The Mail List Criteria window will return.

  12. Click the Execute button.

    The following window will open.

  13. Click the Rebuild button.

    A confirmation window will open.

  14. Click the Yes button.

    Theatre Manager will highlight each group as it is executed.

    The Mail List Criteria window will open to the Who's In tab. Patrons with last names starting with the letter A will now be removed from the list.