cfoutput group by
Hi, my report is similar to the table below. I need to to get the total of each state but my query didn't work, can you please help !!
| State | Cost |
|---|---|
| TX | 125 |
| TX | 500 |
| Total | total of TX |
| MO | 100 |
| MO | 215 |
| Total | total of Mo |
| CA | 500 |
| Total | total of CA |
<cfoutput query="getall">
<cfset subtotal = 0 />
<tr>
<td>#state#</td>
<td>#amount</td>
</tr>
<tr>
<cfoutput group ="sate">
<cfset subtotal = subtotal + amount />
</cfoutput>
<td>#subtotal#</td>
</tr>
</cfoutput>
thanks
