Conquering Query

Sometimes I review the calls that come into the ResultsPlus support lines to get ideas on what to blog about. It’s always interesting to see and hear what customers are calling and talking about. And without fail, over the thirty years we’ve been in the business, the most common question asked is always ‘how do I build a query to… (insert example here).’

If you’re one of those people who salivates when you hear or read the word query, this posting will be boring and very unhelpful. You’ve likely already decided that queries are like a brain-teaser – a puzzle to be riddled through and figured out. If so, good for you and have fun!

But if you’re one of those people for whom the word query produces a different physical response, one that looks like perspiration and feels like anxiety, I’m going to offer a suggestion that may help you get a handle on how to get going on a query. Instead of beginning at the ‘I don’t know what I’m doing’ point, start with what you DO know – your donors.

Let’s use a simple example where you are scheduling an event to honor people who have recently passed away.

Step 1: Describe it.

Using written or verbal language, describe in detail the list you are trying to build or data you are trying to find. The more accurately you can define it, the easier the query will be to write. Example:  Show me a list of people who have died since the beginning of 2015.

Step 2:  Personalize it.

Think of an example of someone who you know will qualify for this query. This is the step where you use what you know. Put your database to the test using that knowledge. Example: Terry Williams, a former staff member, died last year on April 12th. They should definitely appear on the list produced by this query.

Step 3:  Prove it.

Review the exact pieces of data in Terry Williams’ constituent record that prove why she qualifies for this query. Look up her record, navigate to the General Information area, and confirm that the Death Date field displays a value of 4/12/15.

Step 4:  Apply it.

Now that you have identified the exact piece of data that holds the information you’re looking for, apply that knowledge to everyone in the database. Find everyone in the database who has a death date in the range you’re looking for.

Step 5:  Build it.

death date
Start by floating your mouse over the field label for the ‘Death Date’ field and watch the little hover-help blippie that appears:  Folder.DeathDate. That signifies that the data is stored in the Folder table, in a field called DeathDate.

Your task is now to find everyone in the database with a value in that field that is on or after January 1st, 2015. Using the Query Designer, here’s what your query will look like

query design


This is obviously a simple query, and your needs will likely be more complex than this example, but it’s a good place to start if you just need to understand the concept. From here, you can use your actual needs to build on your knowledge and your skills until you become the query master of your organization.

In the meantime, don’t forget that you can use the support team as your lifeline to help you get moving in the right direction. We’re here to help and happy to do it.