The problem is dynamic sql. Save yourself some headaches and don't use dynamic sql. It's never as easy as it looks ;-) Plus it's hard to debug and is a big sql injection risk if done wrong ...
But .. it doesn't look like you even need to return the query. You can just return the count. But dont' forget to VAR your cfquery's and use cfqueryparam
...
<cfset var qry = "">
<cfquery name="qry" ...>
SELECT count(status) AS Result
FROM table
WHERE status = <cfqueryparam value="#arguments.status#" cfsqltype="cf_sql_varchar">
</cfquery>
<cfreturn qry.Result>
... I didnt know why it has 3 apostrophes
CF escapes single quotes to protect you from sql injection. The only way around it is to use PreserveSingleQuotes(). But then you're at risk for sql injection. Since you don't seem to need dynamic sql anyway, my advice is to avoid it altogether.