Using cfquery GROUPED output inside CFMAIL
Having a problem with displaying grouped CFQUERY results in a CFMAIL. Having researched this issue on these forums and the internet, I found some helpful information, but have been unable to find the answer to my specific issue...
Here's what I'm trying to do. I want to send just one CFMAIL to one user. So far, so good. I'm not using CFOUTPUT in the CFMAIL and it correctly displays CF variables.
The problem is this: I have a CFQUERY that uses the GROUP parameter and I want to display those results all in ONE email. The display works if outside of the CFMAIL:
<cfoutput query="GetHoliday" group="year">
<b>#year#</b><br>
<cfoutput>#DateFormat(holiday,"mm/dd/yyyy")#- </cfoutput><br><br>
</cfoutput>
The output looks like this:
2010
02/05/2010 - 03/05/2010 - 05/23/2010
2009
06/07/2009 - 07/05/2009 - 08/23/2009
However, inside the CFMAIL it doesn't work. First I took out the CFOUTPUTs and used CFLOOP, but then I can't use the GROUP attribute.
I tried the GROUP attribute on the CFMAIL, but that sends one email per group. I only want one email sent, and the grouped results in that one email as displayed above.
Any ideas on what I'm doing wrong?
Or is there a way to run the group outside the CFMAIL, store in a variable and somehow display it? I'm guessing no since the query is a complex data type...
