There is a bug in the processing of nested cfloop tags in Macromedia ColdFusion MX, as the example below shows. I have developed a workaround for this which is also below.
<cfloop query="outerqueryset">
<cfloop query="innerqueryset">
<cfoutput>#outerqueryset.column1# #innerqueryset.column1#<br></cfoutput>
</cfloop>
</cfloop>
‘outerqueryset.column1’ results in the first record’s data being displayed regardless of current iteration in the outer loop.
The workaround is to force the display of the current row, by accessing it via array.
<cfloop query="outerqueryset">
<cfloop query="innerqueryset">
<cfoutput>#outerqueryset.column1[outerqueryset.currentrow]# #innerqueryset.column1#</cfoutput>
</cfloop>
</cfloop>