RE: cfquery "order by" question

2007-12-20 Thread Dave
You need to set the sortORD for the remaining values to greater than the last important item for that query. If you had 3 item that were important, you would need to set the sortORD to 4 for the rest of the items, that would allow the secondary sort to actually sort. > -Original Message-

RE: cfquery "order by" question

2007-12-19 Thread Andy Matthews
Coalesce kicks hiney. It's so useful. -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 19, 2007 12:15 PM To: CF-Talk Subject: Re: cfquery "order by" question > Use something like > ORDER BY COALESCE(sortORD,) ASC, #g

RE: cfquery "order by" question

2007-12-19 Thread Brad Wood
Coalesce simply returns the first non-null value. Like MS SQL's isnull, but it can take more arguments. ~Brad -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 19, 2007 12:15 PM To: CF-Talk Subject: Re: cfquery "order by" question

Re: cfquery "order by" question

2007-12-19 Thread Les Mizzell
> Use something like > ORDER BY COALESCE(sortORD,) ASC, #getPAGE.sortMETH# Ooo - that works. Actually, I'll admit to having never seen "coalesce" before. Thanks very much! That eliminates something far more convoluted! Les ~~~

Re: cfquery "order by" question

2007-12-19 Thread Les Mizzell
> I *think* I understand what you are asking. > What is the sortORD column value for the other 12 records you want to > come after the first three? Currently null, though I could set it to default to something else. I suppose "" might be a good idea actually, then there would be a valu

Re: cfquery "order by" question

2007-12-19 Thread Jim Wright
> How do I get my numberic sort fields to take priority and come up first > without maybe having TWO queries defined and two output blocks? Use something like ORDER BY COALESCE(sortORD,) ASC, #getPAGE.sortMETH# ~| AdobeĀ® Cold

RE: cfquery "order by" question

2007-12-19 Thread Brad Wood
I *think* I understand what you are asking. What is the sortORD column value for the other 12 records you want to come after the first three? If it is null or 0 then that is probably why they are sorting to the top. You need to have something like this probably: sortORD,name, amount,