I am trying to create a chart with a query of queries, but am receiving a 500 error no matter what I try. I ended up scoping down the cfchart tag as the problem, but couldn't find any syntax errors in it, nor any logical errors.
<cfquery name="getData" datasource="#dsn#">
SELECT
( SELECT Count(UserID)
FROM Users
WHERE StripeCustomerID IS NOT NULL
) AS 'Licenses'
, COUNT(UserID) AS 'Registrations'
, UserID AS 'User'
FROM Users
WHERE DATEDIFF(hour, FirstContact, DateStamp) <= '12'
GROUP BY UserID
</cfquery>
<cfquery name="queryOfQuery" dbtype="query">
SELECT (Licenses/Registrations) AS Percent FROM getData
</cfquery>
<cfchart format="flash">
<cfchartseries type="bar"
query="queryOfQuery"
itemcolumn="UserID"
valuecolumn="Percent" />
</cfchart>
Sample Data
Users Table Sample Data
UserID StripeCustomerID
35 cus_8LOSlmvEQcfg1g
36 cus_6ixCBe7aU1MJEt
50 NULL
60 cus_6ifLCNmR9rOBCl
69 NULL
70 NULL
72 NULL
73 NULL
74 NULL