Thanks Bert, I've tried that though. That just screws up the query.

-R

==============
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>
==============

-- 
Russell Jones
Webmaster
ImproveNow.com
Phone: 207.236.0146
e-mail: [EMAIL PROTECTED]

> From: Bert Dawson <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 24 Oct 2000 18:13:23 +0100
> To: Fusebox <[EMAIL PROTECTED]>
> Subject: RE: ... should be a simple query question ...
> 
> I don't really know access, but maybe you want to drop the '=' sign from the
> condition:
> ie 
> AND    m.MessageDateCreated >  ALL
> (
> SELECT Min(m.MessageDateCreated)
> etc
> 
> Bert
> 
> -----Original Message-----
> From: Russell Jones [mailto:[EMAIL PROTECTED]]
> Sent: 24 October 2000 17:54
> To: Fusebox
> Subject: Re: ... should be a simple query question ...
> 
> 
> Thanks for the site recommendation, I'll be sure to check it out :)
> 
> The "nested select" seems to work fine in access ... giving no error ... it
> just doesn't return the right data :(
> 
> -R
> 
> ==============
> 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: "McCollough, Alan" <[EMAIL PROTECTED]>
>> Reply-To: [EMAIL PROTECTED]
>> Date: Tue, 24 Oct 2000 08:10:59 -0800
>> To: Fusebox <[EMAIL PROTECTED]>
>> Subject: RE: ... should be a simple query question ...
>> 
>> That's called a 'nested Select'. Ya can't do it in Access. Either that or
>> I'm wrong again.
>> 
>> Anyhow y'all would be wise to hop over to www.swynk.com , there are some
>> serious SQL gurus over there...
>> 
>> Alan McCollough
>> Web Programmer
>> Allaire Certified ColdFusion Developer
>> Alaska Native Medical Center
>> 
>>> -----Original Message-----
>>> From:    Jeffrey Marsh [SMTP:[EMAIL PROTECTED]]
>>> Sent:    Tuesday, October 24, 2000 8:18 AM
>>> To:    Fusebox
>>> Subject:    RE: ... should be a simple query question ...
>>> 
>>> How come you have the SELECT statement in the WHERE clause surrounded by
>>> parenthesis without an AND conjunction? Does this query work from within
>>> Access?
>> {redacted uh huh...}
>> 
> ----------------------------------------------------------------------------
> --
>> 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.
> ------------------------------------------------------------------------------
> 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