-
1. Re: Value List Q of Q Question
-==cfSearching==- Aug 27, 2009 12:40 PM (in response to Dan Bracuk)<cfoutput>
#arrayToList(q1["one two"])#
</cfoutput>That would work for the valueList. I do not know of any way to reference an invalid column name directly in a QoQ. But you could always rename the column so to speak ..
<cfset queryAddColumn(myQuery, "NewColumnName", myQuery["one two"]) />
-
2. Re: Value List Q of Q Question
Dan Bracuk Aug 27, 2009 2:49 PM (in response to -==cfSearching==-)I ended up using QueryAddColumn. I was wondering if I could work with the original query.
-
3. Re: Value List Q of Q Question
-==cfSearching==- Aug 27, 2009 3:02 PM (in response to Dan Bracuk)If you use QueryAddColumn, you can still use the original query. But I do not know of any way to reference the invalid column name in a QoQ. AFAIK, you must use the renamed column instead
<cfquery name="myQuery" datasource="SomeDSN">
SELECT 'b' AS [One Two] UNION
SELECT 'c' AS [One Two] UNION
SELECT 'd' AS [One Two] UNION
SELECT 'a' AS [One Two]
</cfquery><cfset queryAddColumn(myQuery, "NewColumnName", myQuery["one two"]) />
<cfquery name="newQuery" dbtype="query">
SELECT *
FROM myQuery
WHERE NewColumnName LIKE '%something%'
</cfquery>
<cfdump var="#newQuery#">

