Ok I managed to do this after some headbutting against a brick wall trying to assign valuables to a workflow variable. Looking at the included demo Workflows helped in this regard but it would be nice if there was a reference of script functions etc. on the CommVault Documentation site to help with this.
Anyway, as a learning exercise I simply wanted a summary of how many associations there are for all my Schedule Policies.
I start off with a string variable defined for the workflow called "EmailBody" which is assigned "<table><tr><th>Schedule Policy</th><th># of Associations</th></tr>".
Then I execute a CommServeDBQuery which outputs all my Schedule Policy ID's and names.
I then use a ForEach to cycle through each policy and run another CommServeDBQuery to get a count of SubClients using the Schedule Policy ID.
After the query I run a script which simply appends the HTML row to the "EmailBody" workflow variable with.
And finally I send an email at the end, although I have an OnStart script there to append the "</table>" text.
That should be all you need to do to get a nicely formatted HTML body out of an SQL query.
It's somewhat convoluted for such a simple query but it gives me a foundation for one of my automation tasks which will be to automatically select a Schedule Policy for new clients based on the number of associated SubClients.
Hope that helps!