Duane Hookom said:
Without a better understanding of your table structure, data, and what you
are attempting to do I can only suggest there may be a method of
accomplishing this all in one query.
Understood. The nature of the data and the structure I feel necessary
to emphasize is pretty complex (as I imagine is the case with most
databases). Simply put, there are three levels to the hierarchy:
(1) A tipcode records the state of the most recent dial of a phone
number, e.g. "no answer", "completed interview", etc. Each phone
number dialed can have only one tipcode at any time, though a "no
answer", upon dialing later, may become a "completed interview". In
that case, the history of that number will be erased, and we will only
ever know that it became a "completed interview".
(2) A subcategory collects a few tipcodes into one narrowly focused
context, e.g. "busy", "no answer", and "disconnected" are all forms of
the context "no contact".
(3) A category collects subcategories into a broader context, e.g.
the "no contact" and "immediate refusal" subcategories are both forms
of the context "no substantive response".
At the moment, all I care about is the category level; however, I know
I'll eventually need to tease out the finer details.
You should have a tipcode table that
stores a category value of "Dialer Issues" for records with values
204,207,208,209,210,221,225,234. I think you are making this overly complex
with your expressions. This should all be data driven possibly using a
simple crosstab query.
My approach had been to create queries at the subcategory level, and
simply compile the queries themselves into the categories. I think
now, having tried that approach, that the difficulty of this method
outstrips any efficiency I might expect. And, really, if we have the
following situation:
subcategory A = (204, 207, 208)
subcategory B = (209, 210, 221)
subcategory C = (225, 234)
union(A, B, C) = (204, 207, 208, 209, 210, 221, 225, 234) = category
ABC
I thought this might have been a naive approach, flying in the face of
the power that Access had to provide. Maybe, as you say, I should
"Keep It Simple Stupid", and keep everything a simple collection of
the tipcodes themselves.
....unless someone can see a more efficient way of going about this?
Thank you, Duane.
Daniel