Rick,

Are you getting an error or is just not sorting? If you're getting an error,
make sure to explicitly define the columns in your ORDER BY clause:

ORDER BY P.Price, P.Designer, P.Size

If the columns appear in multiple tables (specified in your query) then you
need to tell the query which specific columns they should be sorting on,
because you can sort by data not returned in the SELECT statement.

-Dan

>No matter what I do, I can't seem to get the following query to ORDER by
>either Size or Price. It will only order by Designer. If I place either
>Price or Size in the order clause, the order clause is ignored. If I place
>Designer in the order clasue, it orders correctly.
>
>Any ideas?
>Thanks
>Rick
>
><cfquery name="getproducts" datasource="wioDB"
>cachedwithin="#CreateTimeSpan(0,0,10,0)#">
>SELECT P.ProdID, P.Designer, P.Size, P.Price, I.Image, I.IsPrimary,
>C.Category
>FROM Products P, Images I, Category C
>WHERE P.ProdID = I.ProdID
>AND P.CatID = C.CatID
>AND IsPrimary = 'Yes'
>AND Status = 'Approved'
>
><cfif URL.Category EQ 'Dresses'>
><cfset type = 'Dresses'>
>AND C.CatID = 1
></cfif>
>
><cfif URL.Category EQ 'Pants'>
><cfset type = 'Pants'>
>AND C.CatID = 2
></cfif>
>
><cfif URL.Category EQ 'Special Occasion Dresses'>
><cfset type = 'Special Occasion Dresses'>
>AND C.CatID = 3
></cfif>
>
>
>ORDER BY Price
></cfquery>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257800
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to