Compound Queries
Compound queries are used when you want to combine the results of two other queries to come up with a new set of results. In a compound query, you can combine the queries by adding their results together, subtracting the results of one query from the other, or intersecting the results to find only the accounts or entries that exist in both queries.

-
From Queries, click Manage Queries. The Query Categories page appears.
-
Select a category or create a new one.
-
Once inside a category, click New Compound Query under Tasks.
-
Under Query Basics, enter a name and description for your query. Be as descriptive as possible so that you and other users in your organization know what the query is used for.
-
To mark this query as a favorite, select Favorite Query. Links to your favorite queries appear on your eTapestry home page when you use the Favorites tile. For more information about customizing your home page, see Custom Home Page.
-
To hide this query from other users in your organization, select Private.
-
To prevent other users in your organization from editing this query, but allow them to see and use it, select Read Only.
-
Under Query Type, select Change Query Type to change the query to be dynamic or static. Dynamic queries reflect updated data every time you run them or use them to send communications or run reports. Results for static queries are not updated when data changes in the database.
-
Under Results, select the appropriate option depending on the type of results you want on the Data Return Type field. To see results related to accounts, such as if you are querying on individuals, select "Accounts." If your query is looking for gifts or donation-related results, select "Journal Entries." For more information about data return types, see Data Return Types.
-
If you select Related Accounts in the Data Return Type field, select an option in the Relationship Info field.
-
Under How would you like the results of each query to interact?, select how you want to combine the results.
-
To query on items that appear on both queries, select Intersect.
-
To query on items that appear on either query, select Add.
-
To query on items that appear on one query but not the other, select Subtract. This is the only option for which the order of the queries can alter the results.
-
-
Under Query 1, select the category where the query is located and the query.
-
Under Query 2, select the category where the query is located and the query.
-
Click Save And to create the query.

When you send mail, do not send items to bad addresses, constituents who opted out of mailings, and the deceased. To send mail to a clean list, first create a query that identifies the accounts to exclude. When the mailing is an appeal for fundraising or sales, you should also exclude accounts marked as Do Not Solicit. For more information, refer to Create a "Do Not Mail" query. Next, create a compound query that includes the accounts you want to send mail to, but excludes the accounts you need to prevent from receiving the mail.
-
From the Queries, click Manage Queries. The Query Categories page appears.
-
Click on a category to select it, or to create a new category click New Category under Tasks. After you access a category, the Edit Query Category page appears.
-
Click New Compound Query under Tasks. The Create a New Compound Query page appears.
-
For the Name, enter "Clean Mailing List. "
-
Enter a description so that you and other users in your organization know what the query is used for. You can use this "Clean Mailing List" query to send mail. You can also use it as the starting criteria for other queries if you need to further define your mailing lists. This is a compound query which subtracts the "Do Not Mail" query from the "All Constituents" query.
-
Select Change Query Type under Query Type and select Dynamic Query.
-
From Data Return Type, under Results, select Accounts. For more information about data return types, see Data Return Types.
-
Under How would you like the results of each query to interact?, click Subtract.
-
Under Query 1, for Query Category select Base. For Query, select All Constituents - A.
-
Under Query 2, for Query Category select Base. For Query, select Do Not Mail.
-
Click Save and to save the query and navigate to the page selected in the Save And menu. You are ready to use this "Clean Mailing List" query to send mail. You can also use it as the starting criteria for other queries if you need to further define your mailing lists.