>What is the point of such strange code? Why not take the count into a variable first and then add it as a field whatever number you need?
>
>In addition, the problem you're facing is called parameter sniffing. Check Plamen Ratchev article
>
>
Parameter Sniffing>
What is the point? No point... just a bad query by a dumb programmer. Sometimes I get stuck in a certain mindset and forget about things like including a sql select as a field in the query (See Sergey's sample code). Thanks for the link, I am reading about Parameter Sniffing now.
Brandon Harker
Sebae Data Solutions