An excellent question, and one to which I don't have an answer, sorry! :(
I've been constructing my queries in parts as separate strings.; the SELECT clause, the FROM clause (incl. joins) and the WHERE clause.
When I need to get the count I just create a new query with the query string stating "SELECT COUNT() ", append the FROM and WHERE clause strings and then re-add the all the parameters.
A bit of a pain, but it works.
If anyone else out there has a more elegant solution I'd love to hear it too!
Cheers,
Symon.
|