macromedia.coldfusion.database_access
[Top] [All Lists]

Condition select/sort of a query of a query?

Subject: Condition select/sort of a query of a query?
From: "kiyomi" <webforumsuser@xxxxxxxxxxxxxx>
Date: Tue, 22 Jul 2008 23:43:06 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

Hi, I'm executing a CFLDAP query to retrieve accounts that are set to expire 
and/or have a specific phrase in the Notes field.  That part works fine.

 I now want to query that cfldap result using a conditional select.  Something 
like this:
        <CFQUERY dbtype="query" name="Results">
        select case manager
                when manager is null info
                else manager
                end
        from PreResults
        order by this
        </cfquery>
 but it returns this error: 
 Query Of Queries syntax error.
 Encountered "case. Incorrect Select List, Incorrect select column, 

 A seperate oddity I encountered when I tried:
        <CFQUERY dbtype="query" name="Results">
        select *, #ReplaceNoCase('PreResults.manager', 
',OU=Users,OU=Onyx,DC=Onyx,DC=local', '')# as this
        from PreResults
        order by this
        </cfquery>
 This successfully returns the recordset as if the Replace command didn't 
execute.  A cfdump shows the "this" field as still containing all the strings I 
tried to replace.  If I put the replace in the cfoutput, it works fine.  I 
could understand it crashing during the query, but it executes just fine.

 What am I doing wrong? TIA!


<Prev in Thread] Current Thread [Next in Thread>