Hi Terry
I tried your solution and it worked out very well.
I had to work a little bit on each of my parameter's properties, but it finally did what i was expecting.One query does everything when i tought i had to create many many queries for every combination of parameters.
And even if my tables content over 7 millions records, the execution is not that slow.
Thanks again
Gilles