Page 1 of 1

Sorting people in multiple activities

Posted: Wed May 27, 2009 12:59 pm
by aatarsus
We have Activities and Skills codes for both Sunday School Classes and Small Groups. I'm trying to produce a report of just those who are members of both a Sunday School Class and a Small Group. I can run a custom report and get all those in Sunday School and run another report and get all those in Small Groups, but when I run the report using the same queries with "and" as the connector PC tells me that there are no records matching the description. What am I doing wrong?

Re: Sorting people in multiple activities

Posted: Wed May 27, 2009 4:03 pm
by NeilZ
I'm trying to remember if this type of query can be constructed using the current report writer. I'm fairly sure it can't be done since it requires an inner join which basically returns only the records that satisfy the two queries. (IE: is in Activity 1 and and in Activity 2).

Here's a definition of an inner join: http://en.wikipedia.org/wiki/Outer_join#Inner_join

Re: Sorting people in multiple activities

Posted: Thu May 28, 2009 10:57 am
by Zorak
This is correct. You could query for activity=1 AND activity=2, but it would return zero results, since no single record in the activities database meets both conditions. If you use the OR connector, you will get everyone that is a member of one or the other or both.

If you do it that way, you could do the following:

In the output fields, make sure that "last, first" and "skill number" are included.
- Group first on "last, first"
- Count the skill number field

In the report form, enter "cnt_skill_no>=2" in the Print When for each of the output fields.

It's a bit of a hack, but it will do what you want!