Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Need to get totals from certain rows.

$
0
0

I ended up going a different route altogether.  This one not only gives me the state totals, it gives me annual totals.

 

<cfoutput query="by_year" group="proj_year">

<h2>#proj_year#</h2>

<table class="datatable pc100">

<tr>

<th scope="col" width="12%">State</th>

<th scope="col">Name</th>

<th scope="col">Project##</th>

<th scope="col" width="12%">Funding Amount</th>

</tr>

<cfoutput group="name">

<cfoutput>

<tr>

<td scope="row">#htmleditformat(name)#</td>

<td>#htmleditformat(proj_name)#</td>

<td>#htmleditformat(project_no)#</td>

<td align="right">#LSCurrencyFormat(funding_amt,"local")#</td>

</tr>

<cfset total = total + funding_amt>

<cfset ytotal = ytotal + funding_amt>

</cfoutput>

<tr>

<td colspan="3" class="txtbold">Totals for #htmleditformat(name)#</td><td align="right" class="txtbold">#LSCurrencyFormat(total,"local")#</td>

</tr>

<cfset total = 0>

</cfoutput>

<tr>

<td colspan="3" class="txtbold">Totals for #htmleditformat(proj_year)#</td><td align="right" class="txtbold">#LSCurrencyFormat(ytotal,"local")#</td>

</tr>

</table>

<cfset ytotal = 0>

</cfoutput>


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>