Try something like this.
> <cfoutput>

> <tr>
> <td>#totaltrials#</td>
> <td>#variety#</td>
> <td>#avgyield#</td>
<CFSET trialpercent = (totaltrials/variety) * 100>
<TD>#trialpercent# %</TD>
> </tr></cfoutput>

Is that what you are trying to do?
You can also use the NumberFormat(trialpercent, arg). You will want to look
it up to see how to set it to 1 or 2 decimal places.

----- Original Message -----
From: Deanna L. Schneider <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 26, 2000 6:53 AM
Subject: grouping with math functions


> Okay, let me re-state my question of yesterday.
>
> I have the results of a query printing out like so:
> <h3>Side By Side Results</h3>
> <cfoutput query="getaggresults2" group="standage">
> <h4>Stand Age: #standage# Year</h4>
> <table cellpadding="5">
> <tr>
> <th>Total Trials</th>
> <th>Variety</th>
> <th>Yield</th>
> </tr>
> <cfoutput>
>
> <tr>
> <td>#totaltrials#</td>
> <td>#variety#</td>
> <td>#avgyield#</td>
> </tr></cfoutput>
> </table>
> </cfoutput>
>
> Notice that I'm using the implicit loops that occur with <cfoutput>.
>
> The problem is, what I really want to do is divide the first outputted avg
> yield by the second outputted avg yield and multiply by 100 to get a
> percentage. I'm thinking I might need to output into a structure or
> something, but I've never worked with structures, and I'm not even
positive
> this would be the best approach.
>
> Suggestions?
>
> Url is http://dev.cf.uwex.edu/ces/ag/alfalfa
>
> Thanks,
> Deanna
>
>
>
> ************************************************************
> Deanna Schneider
> Interactive Media Developer
> UWEX Cooperative Extension Electronic Publishing Group
> 103 Extension Bldg
> 432 N. Lake Street
> Madison, WI 53706
> (608) 265-7923
>
>
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to