• I have to say I prefer the CASE approach to code such as this. Also remember that proper indexing of tables and thoughtful arrangement of parameters according to most frequent usage probably offsets performance to some extent. Granted I would not use this technique for heavily used performance intensive situations, but this is fairly straightforward coding in cases such ad ad-hoc reporting where performance is not as critical and versatility of code is important. And that assumes that code is written to avoid ad-hoc usage returning inordinately large sets.:-)