Conversion failed when converting the varchar value

  • i try to run this simple query and recieved this message:

     

    query: select Debts.Balance * (-1) from debts

    message: Conversion failed when converting the varchar value '2887.5         ' to data type int.

     

    what should i do?

  • It appears that the Balance column is not numeric but char(16).  You need to do one of the following:

    a)  change the Balance column to a money or float datatype

    b)  Select Cast(Debts.Balance as float) * (-1) from debts

    [font="Arial"]Clifton G. Collins III[/font]

  • hi,

     

    i chose the option 'b' and it is working.

    thank u very much

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply