> ...I have more than 90 lines in one SQL statement (including select, where, group, order...)
That's a really big query! Just out of curiousity, why is it so big? Are you joining a lot of table together?
As to your original question, I still don't have a better answer than using an IF. You could place each query in a seperate stored procedure but I not sure if the result set would come back correctly if you called it from another stored procedure. Try it - maybe it will work. Or worst case, you could make two calls from the client (or middle-tier). One to look in the current data and one for history.
-Mike