It only returned 1 record because (I would assume) that ThreadID would
be the last record once it reached there.

I worked around it though. When someone posts a message, I update the
first thread with the last posted date and sort on that. :) Feels a
little like a kludge, but it's clean enough for me to be comfortable
with it.

On Mon, Jun 2, 2008 at 3:39 PM,  <[EMAIL PROTECTED]> wrote:
> It looks like it should return a result for you.  I would suggest adding the 
> 'posted desc' to the order by of the query in a query line, in case your 
> messages are not sorting correctly.
>
> william
>
> William Seiter (mobile)
>
> Have you ever read a book that changed your life?
> go to:  http://www.winninginthemargins.com
> and use passcode: GoldenGrove
>
> -----Original Message-----
> From: "Phillip Vector" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[email protected]>
> Sent: 6/2/2008 2:34 PM
> Subject: Order by another query
>
>
> I have a query that pulls all the top messages in a forum for each
> area (So I have the thread titles).
>
> I want to sort by the last posted, but it isn't working..
>
> This is the code I came up with so far..
>
>        <cfquery datasource="#datasource#" name="AllMessages">
>                select *
>                from forum_messages
>                where areaID = #session.areaID#
>                order by sticky DESC, Posted DESC
>        </cfquery>
>
>        <cfquery name="Messages" dbtype="query">
>                select *
>                from AllMessages
>                where MainThread = 1
>                order by sticky DESC
>        </cfquery>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306663
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