Error in display output from cfquery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jsungmin
    New Member
    • Jan 2013
    • 13

    Error in display output from cfquery

    I have query which count all data in table and I try to display the output of count but I got an error
    here the code

    Code:
    <cfquery name="countDATA" datasource="#ds#">
        select count(quest_id)
        from survey_question
    </cfquery>
                    
     <cfset t = #countDATA#>
         #t#
    Error is
    - Complex object types cannot be converted to simple values. in line 481

    481 : #t#
    I'm new in coldfusion,
    tq.. :)
    Last edited by acoder; Jan 22 '13, 01:47 AM. Reason: Please use [code] tags when posting code
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    #t# is the query object. You need to access the field name, e.g. #t.field_name#

    Comment

    Working...