Have you confirmed that storeid is a column name in the query?
You can do that by doing:
<cfoutput>
#qGetOrders.columnlist#
</cfoutput>
It's unrelated,but you also need a comma between the two sort fields i.e.
ORDER BY #orderby# , #updn#
If all else fails (I know this works for Oracle, I haven't tried it for
anything else), if you know the ordinal position of the column, say storeid
is the 2nd column and that your other sort column was the 5th, you can do
ORDER BY 2 , 5
The code is not as readable but it may be a workaround.
-----Original Message-----
From: Joshua Miller [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 09:48
To: CF-Talk
Subject: Sorting a Query of a Query
When attempting to ORDER BY on a Query of a Query, I get the following error
on ALL fields:
Query Manipulation Error Code = 0
STOREID is not a column that can be sorted on.
The query that I'm querying is a "Built Query" using QueryNew(),
QueryAddRow() and QuerySetCell() to create the final query.
Is this possible or am I doing something wrong?
Code:
<cfparam name="startdate"
default="#dateformat(dateadd('yyyy','-1',Now()),'mm/dd/yyyy')#">
<cfparam name="enddate" default="#dateformat(Now(),'mm/dd/yyyy')#">
<cfparam name="orderby" default="storeid">
<cfparam name="updn" default="ASC">
<cfquery dbtype="query" name="qNew">
SELECT * FROM qGetOrders
WHERE dateordered BETWEEN '#startdate#' AND '#enddate#'
ORDER BY #orderby# #updn#
</cfquery>
Joshua Miller
Web Development::Programming
Eagle Technologies Group, Inc.
www.eagletgi.com
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
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