I got all that worked out and I've run into something that has me puzzled with
my output from this. I have 1 row that doesn't output anything in the the yes
vote column and I've checked using a single query to get just that value, which
shows the correct count. All others output correctly using this:
<cfquery name="getpackets" datasource="#dsdata#">
select Id, name
from review_packets order by Id
</cfquery>
<cfif getpackets.recordcount GT 0>
<table style="width:99%;" cellpadding="3" cellspacing="3">
<tr class="hdr" style="font-size:13px; font-weight:bold;">
<td style=" width:200px;">Name</td>
<td>yes</td>
<td>no</td>
<td>abstain</td>
<td>Total votes</td>
</tr>
<cfoutput query ="getpackets">
<cfquery name="getvotes" datasource="#dsdata#">
select vote, count(vote) as thisvote
from packet_votes where packet_id = #getpackets.id#
group by vote
</cfquery>
<tr>
<td>#getpackets.id# - #getpackets.name#</td>
<td><cfif getvotes.vote EQ 'yes'>#getvotes.thisvote#</cfif></td>
<td><cfif getvotes.vote EQ
'no'>#getvotes.thisvote#<cfelse>0</cfif></td>
<td><cfif getvotes.vote EQ
'abstain'>#getvotes.thisvote#<cfelse>0</cfif></td>
<td>
</td>
</tr>
<br />
</cfoutput>
</table>
</cfif>
any ideas??? :(
Thanks again - Bob
>Uh yes you can.
>Maureen's right..
>add a
>
>select name, vote, count(vote) as tally
>from table
>group by name, vote
>
>this will give you a count of votes by person by vote..
>so if John voted 2 times for yes, 1 for no and 7 for abstain
>your output from the query will be
>
>John Yes 2
>John No 1
>John Abstain 7
>
>
>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4482
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15