Hey all,

Using QoQ to get counts of a specific answer within a query with Cold
Fusion 5

When it comes across an apostrophe in the cfqueryparam, seems to be
throwing error as it is expecting a close of the parenthesis.  

Have tried also wrapping it in PreserveSingleQuotes but that did not
work either :-(

Any suggestions?  Am I doing something stupid?

Cheers 

DC

CF Code -----------------------------------
PS Asked the question previously on the list and this is the only way
that someone suggested so that I could get the count to work in the QoQ.

<cfquery name="qCM_GetQuestionAnswersDistinctCount" dbtype="QUERY">
        SELECT  COUNT(RESAREA_VALUE) AS SUBTOTAL, RESAREA_VALUE
        FROM            qCM_GetQuestionAnswers
        GROUP BY        RESAREA_VALUE
        HAVING  (RESAREA_VALUE = <cfqueryparam
value="#qCM_GetQuestionAnswersDistinct.RESAREA_VALUE#"
cfsqltype="CF_SQL_VARCHAR">)
</cfquery>


Ex SQL Output ----------------------------

SELECT  COUNT(RESAREA_VALUE) AS SUBTOTAL, RESAREA_VALUE 
FROM            qCM_GetQuestionAnswers 
GROUP BY        RESAREA_VALUE 
HAVING  (RESAREA_VALUE = 'Gray''s School of Art')


CF Error --------------------------

Query Manipulation Error Code = 0
Expected right parenthesis at:s School of Art' )

SQL = "SELECT COUNT(RESAREA_VALUE) AS SUBTOTAL, RESAREA_VALUE FROM
qCM_GetQuestionAnswers GROUP BY RESAREA_VALUE HAVING (RESAREA_VALUE =
'Gray''s School of Art')"

Query Parameter Value(s) - 
Parameter #1 = Gray's School of Art 
Data Source = ""

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to