All good points shared so far. There's always more than one solution to a problem, and the added caveats and considerations are worthwhile.
I should have clarified that my proposal was one to consider if a) no other solution worked or b) it worked as well or better than any other reasonable alternative. My focus was giving Seth a solution that would at least work. It wasn't clear from his first note if he was considering a simpler solution, versus the single "do it all" query he sought or the "2 queries plus a query of queries" he had tried. And to that point, Seth, you still seem to think the "2 queries plus a query of queries" is the only alternative. I was proposing just a single query, and then looping over that to get the records you want. I was assuming you're creating some output. If you're going with a Q of Q in the end to end up with a query resultset (such as to return from a component or something), I understand that desire. But you've not clarified, so again I just want to make sure you're not seeing the still-simpler solution. I appreciate that what I'm proposing is the "old school" approach, but as has been communicated here, sometimes in our drive to do things "the better right way" we can miss the "good enough way". If you'd say you still think you need 2 queries, at least, no problem. I may have missed something in your requirements. I didn't run any tests and was just eyeballing things. /charlie ------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com -------------------------------------------------------------