I am trying to build up a query, and having troubles getting it to ORDER
correctly I am getting an error:
==============================
Query Manipulation Error Code = 0
QTY is not a column that can be sorted on.
The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (224:10) to (224:46)
============================
It doesn't like to order on this field, I have tested it as a number and it
is a number, I have ran the order by on the "owner" value without trouble.
The end result is to Group all the PRODUCTS together and total up their
quantities so I can see how many of each product I sold and put the TOP
product first and head down from there.
DOES, anyone see what the problem is? Is this even doable? If not, does
anyone have a recommendation of doing it differently?
Here is the query, and the building of the query and then the query of
queries (whew!)
<cfoutput query="getorders">
<cfinclude template="cart_items.cfm">
<cfloop query="cartquery">
<cfset NewRow = QueryAddRow(products)>
<cfset Temp = QuerySetCell(products, "qty", #cartquery.qty#)>
<cfset Temp = QuerySetCell(products, "owner",
#cartquery.owner#)>
<cfset Temp = QuerySetCell(products, "code",
#cartquery.qty#)>
<cfset Temp = QuerySetCell(products, "description",
"#cartquery.desc#">
<cfset Temp = QuerySetCell(products, "price",
#cartquery.price#)>
</cfloop>
</cfoutput>
<cfoutput query="products">
<cfquery name="final" dbtype="query">
select SUM(qty) AS quantity, owner, description, price
from products
group by owner, description, price
order by qty desc
</cfquery>
<cfoutput query="final" group="owner">
(#quantity#) | #owner# | #description#<hr>
</cfoutput>
Thank You
Paul Giesenhagen
QuillDesign
http://www.quilldesign.com
SiteDirector - Commerce Builder
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists