I am getting weird unexpected results when I try to run a cfquery inside of the output of a previous query.
Example:
<cfoutput query="reportInfo">
<tr>
<td>#id#</td>
<td>#name#</td>
<cfif Status EQ 'Complete'>
<cfquery name="submitInfo" datasource="RC">
SELECT *
FROM Action_Log
WHERE Form_ID = '#id#'
AND Action = 'Complete' OR Action = 'Saved'
</cfquery>
<cfset startStamp = submitInfo.Action_Time>
<cfoutput>startStamp</cfoutput>
<td>#startStamp#</td>
<cfelse>
<td>No Completion Date</td>
</cfif>
</tr>
</cfoutput>
When "StartStamp" is output to the page it is shown once for each count in the loop and it does this for each ID so there is a lot of extra.
I thought it should only run the submitInfo query once every time the contain query (reportInfo) output loops through but that is not happening.