One of the guys here just alerted me to a neat little SQL trick that I thought I would share.
I often use count() and sum() to get totals out of the database but I always have issues when there are no records to count and so my nice, neat recordset has empty gaps.
If you want to make it nicer, just change the SQL statment to use the isNull() function!
so, your SQL used to look like:
now looks like:
and now it will always return a number!