well.. i figured it out. i added a 0 to all columns that were "null"
and then it worked.
its like it didnt know what to do with the "null" value. not "null"
as a string, but no value.
anyway, i got it working, and i do not see anywhere that would do
anything to make a 7 anything other than a 7
is there a such thing?
i mean, i know the diff, between a string that is "7" and a numeric
value of 7 but other than that, you could probably argue that a 7 is a
7, right?
tony
On 5/9/05, Stan Winchester <[EMAIL PROTECTED]> wrote:
> Have your tried wrapping the val() function around the value when you add it
> to the query? That way the column will be numeric when you do your sum(Total)
>
> <cfscript>
> myQuery = QueryNew("date,price,quantity");
> newRow = QueryAddRow(MyQuery,2);
> temp = QuerySetCell(myQuery, "date","05/01/2005",1);
> temp = QuerySetCell(myQuery, "price",val(5.95),1);
> temp = QuerySetCell(myQuery, "quantity",val(2),1);
> temp = QuerySetCell(myQuery, "date","05/01/2005",2);
> temp = QuerySetCell(myQuery, "price",val("null"),2);
> temp = QuerySetCell(myQuery, "quantity",val(7),2);
> </cfscript>
> <cfdump var="#myQuery#">
> <cfquery name="getSum" dbtype="query">
> SELECT
> sum(price) As TotalPrice,
> sum(quantity) As TotalQuantity
> FROM myQuery
> WHERE date = '05/01/2005'
> </cfquery>
> <cfdump var="#getSum#">
>
> >Hola peeps!
> >
> >Is there a way to tell the queryNew() function what datatype a
> >particular column is?
> >
> >i have a query that i make that is the result set of a query or two,
> >and i have a total column that i write a number to. the cells may be
> >null, may have a number, but NOTHING else.
> >
> >select sum(Total)
> >from getThis
> >where date = '05/01/2005'
> >
> >and its telling me that it cant perform that operation where an
> >operand is of type varchar. well its not. its numeric.
> >
> >any ideas?
> >
> >thanks
> >
> >--
> >tony
> >
> >Tony Weeg
> >
> >macromedia certified coldfusion mx developer
> >email: tonyweeg [at] gmail [dot] com
> >blog: http://www.revolutionwebdesign.com/blog/
> >cool tool: http://www.antiwrap.com
> >
> >"...straight cash homey"
> >- randy moss, now a raider
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:206151
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54