Subject User queries
Author Tim Meneely
This isn't precisely an IBO question, but since I'm using IBO and IBO will
interact with the solution I hope it's OK to post it here.

I'm updating a contribution management system for non-profit institutions; for
example a private school. It tracks names and addresses, contributions,
people's relationships to the school, and more. Thus the tables are along
the lines of:
- List People
- Gifts (people ID, amount, etc)
- List of Roles (e.g., Alumni, Parent)
- People's Roles (i.e., people ID, role ID)

Those who know SQL and understand the structure of the tables can ask complex
but interesting questions: For example, "show me all the alumni who gave more
than $100 in 2003" or "show me parents and alumni who have given money in the
past but haven't given this year". My problem is how to set up a query
system for my decidedly non-technical users.

I'm only dealing with the "where" clause - the output fields will be
pre-determined by the chosen report.

I've looked at some packaged query solutions, for example the Open
QueryBuilder written by Sergey Orlik and now distributed by the FastReport
people. It would take a lot of work to integrate, and seems to be quite
limited with respect to parenthesis and so forth.

I'm leaning toward a solution where I package a bunch of queries in a table,
with verbose descriptions and SQL in different fields, and writing some
system to get variables from the user. So my first example above might be
called "significant donors within a group of people in one year" and would
prompt the user to select the group, the year / dates to include, and the
cut-off amount. This would also take a lot of work on my part, but at least
I'd wind up with something well-integrated and usable by trained people.

Any thoughts? Feel free to take this off-list if you don't think it's
sufficiently IBO-specific.

Thanks!
Tim Meneely
meneelyt at triple-j.com