The User's Edge
The Official Blog of The Raiser's Edge

What's up with my Query? (Part 1)

We’ve all been there.  It’s happened to everyone.  You spend 3 hours setting up a query to use for a mailing, an annual report, or for your auditors.  When you run it, there always seems to be something wrong with the results…either Robert Hernandez appears in the query results 8 different times, or he doesn’t appear at all!  So what gives?  Why can’t I just see ONLY the results that I need to see?  Where do I begin?
 
The answers usually lie in what’s been set up on either the Criteria tab or the Output tab.  A couple of tweaks here and there, or maybe just a clearer picture of how the query is processing can make all of the difference.  The “What’s up with my query?” series of blog posts will help to uncover the mysteries of Query that have been plaguing your Raiser’s Edge lives…

 
Part 1 Example.  You are querying on everyone in your database who has either the ‘Board Member’ or ‘Staff’ Constituent Code on their record.  Not only do you have 120 results in your query when you were supposed to have 35, but most of the people in your query are showing up several times, sometimes with more constituent codes than just ‘Board Member’ or ‘Staff’.  What’s going on here?
 
Check the Output tab.  You will often see the same constituents appear multiple times in your results if you output Gift Amount, Gift Date, Phone Type, Attribute, or any other field that a constituent can have more than one of on their record.  This type of field is known as a ‘One-to-Many’ field, and is the most common reason for duplicates appearing in your query results (and often helps to inflate the number of records that appear in your results).  Your best bet is to make sure that the records that appear in your query DO meet the criteria that you asked for on the Criteria tab, then save your query and bring it through Export, Mail, or Reports to obtain the desired information about that specific group of records.  For more information on why you’re sometimes seeing double and triple in your query results, you can click on the embedded help link at the top of the Results tab in the query (if you have one-to-many fields in your output), or you can visit BB61118 in our Knowledgebase.

 
Keep your eyes peeled for part 2…