You've created a query record set, not a structure. You could use query of
queries to retrieve the matching record from your record set or you could
use a UDF like this: http://cflib.org/udf.cfm?ID=586
_____
From: sebastian palmigiani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 12 October 2004 2:00 p.m.
To: CF-Talk
Subject: Outputting Structure Key Problem
The following code below can be seen at
http://www.tcmtests.com/files/codetest.cfm
When I try append the following code to it I get an error that the
variable Sleep is not defined
<cfouput>#Score.Sleep#</cfoutput>
How can I output the structure key value that I want?
---------------
<cfquery name="GetAverages">
select AVG(QuizPercent) as AvgPercent, QuizID from test_board_biomed
GROUP BY QuizID
</cfquery>
<cfdump var="#GetAverages#" label="new">
<cfset Score = StructNew()>
<cfoutput query="GetAverages">
<cfset Result = StructInsert(Score,QuizID,AvgPercent)>
</cfoutput>
<cfoutput>Count: #StructCount(Score)#</cfoutput>
<cfloop collection="#score#" item="x">
<cfoutput>#x# #Score[x]#</cfoutput><br>
</cfloop>
_____
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Outputting Structure Key Problem sp
- Outputting Structure Key Problem sebastian palmigiani
- RE: Outputting Structure Key Problem James Holmes
- RE: Outputting Structure Key Problem Matthew Walker
- RE: Outputting Structure Key Problem James Holmes
- RE: Outputting Structure Key Problem James Holmes
- RE: Outputting Structure Key Problem Matthew Walker