Records that do not match my criteria are pulling into the query results

When building a query one will determine the criteria a record must meet in order to appear in the results. However, even with the ciriteria confirmed outliers will pull in. 
Tips on how to remove incorrect results from query:

Create an Exclusion Query
The best way to exlude certain indviduals or records from a query is to create an exclusion query. An exclusion query is separate query of criteria that pulls what we do not wish to see in our end results
Example of when to use an exclusion query: In query you requested to only see active members yet expired or lapsed members are still pulling into the results. 
  1. Create a single query where we say Membership Status is equal to active. This will be the only criteria of the query. Save this query as a dynamic selection with the box "Show this Selection in the Query Designer" Marked
  2. Create another query (or return to your orginial incorrect query). On the left in Browse for Fields in > find the yellow folder labeled Selections > Click and highlight > In the middle column in Select Fields find the Exclusion Query that was created > Drag it to Include Records Where > Exists is equal to no. Note: To use exclusion queries successfuly both of the queries must be of the same query source view. You can only exlcude constituents from constituents, memberships from members, etc.
Restrict or Restrain Amount of Current Criteria Using Parentheses 
Another reason results may be pulling in that are outside of your criteria could be the amont of criteria you are dictating. If you are using three or more criteria statements in the "Include Records Where" box be sure to use parentheses. 
The parentheses function in Query is a tool that can narrow query results and make the criteria of a complex query easier to read and track during query construction. Parentheses are a necessary tool if the query uses both AND and OR operators to link criteria as statements
Use AND and OR operators
These operators allow you to combine multiple lines of criteria (or filters) in a query. They can add more specifics to the results you're seeing. 
ANDThe default combining operator in Query. Records must meet both criteria to be selected.Membership Status is equal to Active AND ZIP is equal to 29418
Selects all members who are active and who live in 29418 ZIP code. Jane Smith is the only result. Her membership is active and she lives in 29418.
ORRecords can meet either criteria to be selected.Membership Status is equal to Active OR ZIP is equal to 29418
Selects all members who are active or if they are not a member but live in 29418 ZIP code. For example, Jane Smith is selected because she meets both-- she does not need ZIP of 29418. Mary Jones is also selected for she has an active membership but does not live in 29418.

To learn more about AND or OR operators and How to use Parentheses in query please click here. (BB24257)

Incorrect results could also be because you're not using the correct source view for query. . Click here to learn about which query source view you should use (BB752746)



Was this article helpful?