Error converting data type varchar to float.

  • How about

    CAST (Replace(Performance,',','.') AS DECIMAL(7,3))

    As a side note: Why did you try to cast it to float in between? Shouldn't be needed.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Hi,

    I had similar problem in the past, so without looking into the data i used float which obviously didn't work. Then I figured out that I had comma instead of decimal in my Data.

    Thanks for the help.

  • Hi,

    Actually I want to use Agrregate function on this column like SUM(Performance) and this column also has '0' values in some rows. But instead of '0' it has '-' . So can you give me the syntax to replace both with agrregate on Performance?

    Thanks

  • How about providing table def, ready to use sample data and expected result? It would help a lot more than asking one question at a time...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Hi,

    I got it right .... Ill post data if I have any other questions.

    Thanks

Viewing 5 posts - 1 through 6 (of 6 total)

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