You need a comma between #orderby# and #updn# for one thing.
Dave
----- Original Message -----
From: "Joshua Miller" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, October 17, 2001 9:47 AM
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]
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
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