I had a group column set dynamically for an output query, based on whether
a form variable was passed into the template, as follows:
<cfif parameterexists(icat)>
<cfset queryGroup = 'ItemCategory'>
<cfelse>
<cfset queryGroup = 'Category'>
</cfif>
The variable, "queryGroup," is used in the output query, as: <cfoutput
query="getMainList" group=#queryGroup#> , and this works fine.
Now, I have a situation where, if I pass in another form variable, I don't
want grouping, so I need to include the whole grouping string, instead of
just variable for which column to use. The following works in a CFOUTPUT,
but not in a CFOUTPUT QUERY:
<cfset queryGroup = 'group="ItemCategory"'>
<cfoutput>#queryGroup#</cfoutput>
I've tried all sorts of variations on:
<cfoutput query="getMainList" #queryGroup#>, but I get an "Invalid token"
error as soon as I get to a # or < (as in a CFIF at this position).
Any suggestions? I suppose I could use a CFIF statement and have two
versions of the CFOUTPUT, but I'd rather have dynamic text within one.
TIA,
--John
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists