I am running a query inside a <cfloop>. The first time I run the code, I get the expected results. The next time I run the code, the query returns a Null value and I get the following error:
Error Diagnostic Information
An error occurred while evaluating the expression:
total_m = #get_months_eng.total_month# * 53.07
Error near line 12, column 8.
--------------------------------------------------------------------------------
Cannot convert to number.
Please, check the ColdFusion manual for the allowed conversions between data types
The error occurred while processing an element with a general identifier of (CFSET), occupying document position (12:2) to (12:55) in the template file C:\InetPub\eac_report\eacgetmanload.cfm.
Date/Time: 04/04/01 07:20:55
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Remote Address: 192.168.77.173
Query String: project_number=8800
This is my code:
Why is this happening? Any help would be appreciated!
Error Diagnostic Information
An error occurred while evaluating the expression:
total_m = #get_months_eng.total_month# * 53.07
Error near line 12, column 8.
--------------------------------------------------------------------------------
Cannot convert to number.
Please, check the ColdFusion manual for the allowed conversions between data types
The error occurred while processing an element with a general identifier of (CFSET), occupying document position (12:2) to (12:55) in the template file C:\InetPub\eac_report\eacgetmanload.cfm.
Date/Time: 04/04/01 07:20:55
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Remote Address: 192.168.77.173
Query String: project_number=8800
This is my code:
Code:
<cfset all_months = 0>
<cfset month_num = 1>
<cfloop index="loop_count" from="1" to="18">
<cfquery datasource="eac_report" name="get_months_eng">
SELECT Sum(month#month_num#) AS total_month
FROM eac_manload
WHERE project_number = '#project_number#'
and dept IN (50,51,52,55,57,60,61,62,63,64,65,68,69)
</cfquery>
<cfoutput query="get_months_eng">
#total_month#
</cfoutput>
<cfset total_m = #get_months_eng.total_month# * 53.07>
<cfset all_months = #all_months# + #total_m#>
<cfset month_num = #month_num# + 1>
</cfloop>