I missed the need to have other at the bottom.  Ok, to get Other at the
bottom:


<cfquery datasource="#request.site.dsn#" name="get_child_categories">
SELECT
 categories.cat_id,
 categories.category,
 categories.parent_id
FROM
 categories
WHERE
 categories.parent_id =
 <cfqueryparam cfsqltype="cf_sql_integer" value="#cat_id#">
and
categories.category <> 'Other'
ORDER BY
categories.category
</cfquery>

Then something like:

<cfset temp = QueryAddRow(get_child_categories)>
<cfset temp = QuerySetCell(get_child_categories,"cat_id",value)>
<cfset temp = QuerySetCell(get_child_categories,"category",value)
<cfset temp = QuerySetCell(get_child_categories,"parent_id",value)

Replace the word value with the values you want for the "Other" category.
This is a manual solution, but allows you to manually shape the query
natively.

Teddy


On 9/27/06, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
> As a long term solution, you might want to add a column to your products
> table called "SortOrder" or "Priority" which contains the actual order you
> want the query to output.  This way you are not stuck to any particular
> way
> of sorting (by id, name etc.)  You could make the "Other" category 99999
> or
> something suitably high so it will always be last.  Then in your admin
> section you'll want to be able to modify that column's value so you can
> change the order if necessary.
>
> In lieu of that, I'm sure some folks on here will have a fancy way to get
> that "Other" category to come out at the end.
>
> -- Josh
>
>
>
> ----- Original Message -----
> From: "Doug Brown" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[email protected]>
> Sent: Wednesday, September 27, 2006 11:06 AM
> Subject: Help displaying a query result
>
>
> >I have a list of categories, and I want to sort them ascending, but I
> need
> >to have the category (other) always listed last. Anyone have ideas on how
> >to accomplish this?
> >
> > IE:
> > Baby Backpacks
> > Baby Carriers and Slings
> > Baby Jumpers
> > Play Pens
> > Vibrating Chairs
> > Other
> >
> > My current query is like so...
> >
> > <cfquery datasource="#request.site.dsn#" name="get_child_categories">
> > SELECT
> > categories.cat_id,
> > categories.category,
> > categories.parent_id
> > FROM
> > categories
> > WHERE
> > categories.parent_id =
> > <cfqueryparam cfsqltype="cf_sql_integer" value="#cat_id#">
> > </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:254482
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to