The value coldfusion.sql.QueryTable cannot be converted to a number
Hi,
I have two queries, in two different functions, which both return the SUM of a column, depending on the values from the arguments
I need to subtract query 2 from query 1.
The arguments for both queries are passed using the CreateObject Function
<cfset qry1 = createObject("component","components.adminobjects").Func1(#argument1#,#argument2#)>
<cfset qry2 = createObject("component","components.adminobjects").Func1(#argument1#,#argument2#)>
The queries do get executed accordingly and returns the results accordingly.
The problem occurs when I try to calculate by subtracting the 2nd query form the 1st.
So, to get the results that I need, this is what I do:
<cfset results = "#qry1.sum#" - "#qry1.sum2#">
<cfoutput>#results#</cfoutput>
When I do this, it says:
The value coldfusion.sql.QueryTable cannot be converted to a number
I do not get it, this is because when I output #qry1.sum# or #qry1.sum2# I do get the right figures and they are numbers, but when I do some math on them, I get the error.
Any ideas?
Thank you.
