RE: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-15 Thread Andrew Scott
Have you thought about building it up as an associate array first then sort based on the struct key? Then convert it to a query later? -Original Message- From: Les Mizzell [mailto:lesm...@bellsouth.net] Sent: Saturday, 15 May 2010 8:43 AM To: cf-talk Subject: Re: Is there a way to do

Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Les Mizzell
Is there a way to do an arbitrary sort order on a specific cell? For example, let's say I have a cell colour. Possible values: 1. blue 2. cyan 3. green 4. orange 5. red 6. silver I want to sort on this cell, BUT, I want the order to show all red first blue second green third ... blah ...

Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Charlie Griefer
case statement in the ORDER BY should work. See http://www.devx.com/tips/Tip/17288 On Fri, May 14, 2010 at 9:24 AM, Les Mizzell lesm...@bellsouth.net wrote: Is there a way to do an arbitrary sort order on a specific cell? For example, let's say I have a cell colour. Possible values: 1.

Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh
Is there a way to do an arbitrary sort order on a specific cell? What do you mean by cell? A query, grid, etcetera ...? In general terms, you could assign a sort number to each color (red=1, blue=2, ecetera). Then sort by that value.

Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Les Mizzell
Charlie Griefer wrote: case statement in the ORDER BY should work. See http://www.devx.com/tips/Tip/17288 Checking my syntax, but doesn't seem to work for a query of queries.. Like: cfloop query=featureMENU cfset temp = QueryAddRow(hasMEDIA) cfset temp = QuerySetCell(hasMEDIA, tHEAD,

Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh
Checking my syntax, but doesn't seem to work for a query of queries.. QoQ's are very limited. They do not support CASE statements, AFAIK. If you are using a database query as the source of this information, add a CASE statement to your base database query to generate a column called

Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Les Mizzell
If you are using a database query as the source of this information, add a CASE statement to your base database query to generate a column called SortNumber. Then use that column for ordering. Alternatively, you could add a SortNumber column to your base table. I wish it were that easy.

Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh
In theory, I could add a new database table to the site in question, and populate it every X number of hours on a schedule, but that's not exactly how this is set up to function. Well .. either way, you will have to change to something if the CASE values are not static. Be it a table, or a

Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh
Well .. either way, you will have to change to something if the CASE values are not static. Be it a table, or a SQL query. ... or your CF code. ~| Order the Adobe Coldfusion Anthology now!