I need help with the second query in the query of queries. The IN clause is putting the list of categories in one long string instead of seperating them. I tried the setting a variable and using ListQualify, but that just adds more ' marks. Since it's a variable that is a always more than one what's the correct way of writing that SQL part? Techincally you don't need to be a ColdFusion guy to answer this. I need a DBA.
<CFQUERY NAME="Query1" DataSource="TheDataSource"
>
SELECT Distinct subcategory, count(subcategory) AS subcategorycount
FROM Categories
WHERE BlahTime > ###OtherTime###
GROUP BY subcategory
</CFQUERY>
<CFSET Yo = #ListQualify(form.EventCat
egory, "'",",")#>
<CFQUERY NAME="QOQ" DBTYPE="query">
SELECT Distinct subcategory, count(subcategory) AS subcategorycount
FROM Query1
WHERE subcategory IN ('#Yo#')
GROUP BY subcategory
</CFQUERY>
Start Free Trial