the value cannot be converted to a number

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

    the value cannot be converted to a number

    what can be the problem? Since i tried to write this values like:

    Code:
    <cfset totResponse = #GETTOTSCORE1.a# + #GETTOTSCORE2.b# + #GETTOTSCORE3.c#>
    <cfset avg = #GetSum1.score1# + #GetSum2.score2# + #GetSum3.score3#>
    <cfset totAVG = avg / #totResponse#>
    first calculation to calculate total response and I got error in value #GETTOTSCORE3.c #
    In my oracle the value for #GETTOTSCORE3.c # is 0 and at the website also display 0 in table

    but when I do a calculation for totResponse, it get error for this
    Code:
    <---<cfset totResponse = #GETTOTSCORE1.a# + #GETTOTSCORE2.b# + #GETTOTSCORE3.c#>--->
    I think the value for #GETTOTSCORE3.c #> need to converted into 0.
    How can I fix this?
    tq.. :)
    Last edited by acoder; Feb 20 '13, 02:31 PM. Reason: Please use [code] tags when posting code
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use the val() function.

    If that doesn't work, please post your query for GETTOTSCORE3.

    Comment

    • jsungmin
      New Member
      • Jan 2013
      • 13

      #3
      i'm sorry, how to use function val() ? can you give an example? I'm really new in coldfusion
      and here the query for GETTOTSCORE3.

      Code:
      <cfquery name="GETTOTSCORE3" datasource="#ds#">
          	select count(s.quest_score) as c
              from survey_customer_score s, survey_customer_header h
              where s.quest_score = 3
              and s.survey_id = 1757        
              and s.quest_id = 1759        
              and s.cust_id = h.cust_id
          </cfquery>
      this query is to count score3.
      value score for score3 is 0 in oracle but in coldfusion it can't define the value score3 as 0.
      But now I want to know how to convert score3 into 0 in coldfusion by using function val()

      tq :)
      Last edited by acoder; Feb 21 '13, 12:55 AM. Reason: Please use [code] tags when posting code

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Just put it around your variables - see docs.

        PS. please use [code] tags around your code.

        Comment

        • jsungmin
          New Member
          • Jan 2013
          • 13

          #5
          tq for helping me :)

          Comment

          Working...