Thanks, I'll play with that ... haven't used "TOP" before.

==============
I need this query to get all messages in a thread except the first message
that started it. What I have clearly does not work. I seems like it should,
but it doesn't. 

<cfquery name="request.getMessageTaxonomy" datasource="#request.userdsn#">
    SELECT m.*, m.MessageID AS ItemID, m.MessageParent AS ParentItemID
        FROM Messages m
            WHERE    m.ThreadID = #attributes.ThreadID#
            AND    m.MessageDateCreated >=  ALL
            (
                SELECT Min(m.MessageDateCreated)
                FROM    Messages m
                WHERE    m.ThreadID = #attributes.ThreadID#
            )
            ORDER BY m.MessageDateCreated ASC
</cfquery>
==============

> From: "Jeff Peters" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 24 Oct 2000 12:13:26 -0400
> To: Fusebox <[EMAIL PROTECTED]>
> Subject: Re: ... should be a simple query question ...
> 
> On 23 Oct 00, at 22:38, Russell Jones wrote:
> 
>> First off, I'm using Access 2000...
>> 
>> I need this query to get all messages in a thread except the first message
>> that started it. What I have clearly does not work. I seems like it should,
>> but it doesn't. 
> 
> Check out Access' TOP predicate (instead of ALL as in your example).  It
> allows 
> you to return only the number of records specified from the top of the return
> set.  By negating it, you can return everything EXCEPT that number of records.
> Assuming your originating message is first in the recordset, this should take
> care of the problem.
> 
> - Jeff
> 
> ==============================================================
> | Jeffrey S. Peters       | "Specialization is for insects." |
> | [EMAIL PROTECTED] |                 - Lazarus Long   |
> ==============================================================
> ------------------------------------------------------------------------------
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
> body.
> 

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to