Skip to main content
February 17, 2011
Question

Query of query Max Case Error

  • February 17, 2011
  • 2 replies
  • 497 views

I tried to execute a stored procedure then tried to perform MAX Case select of the cached query. CF return me "Query of query syntax error". Can someone pls

shed a light?

<cfstoredproc procedure="Testing" cachedwithin="#CreateTimeSpan(1,0,0,0)#"

          USERNAME="#SP_U#" PASSWORD="#SP_P#" DATASOURCE="#SP_DSN#" DBTYPE="ODBC" RETURNCODE="yes">
  <cfprocresult name="qResults">
</cfstoredproc>

<cfquery name="QoQ" dbtype="query">
      Select Max( Case Choice When 'A' Then 1 Else 2 End) As C

     </cfquery>

    This topic has been closed for replies.

    2 replies

    February 17, 2011

    The second query should be:

    <cfquery name="QoQ" dbtype="query">
          Select Max( Case Choice When 'A' Then 1 Else 2 End) As C
    From qResults
    </cfquery>

    Owainnorth
    Inspiring
    February 17, 2011

    Does QoQ support case statements? The Livedocs don't seem to think so.