convert nvarchar(number with thousandsseparator) to integer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rene Sluiter
    New Member
    • Dec 2010
    • 1

    #1

    convert nvarchar(number with thousandsseparator) to integer

    Guys, I've been trying to convert/cast a nvarchar value like
    719.928,000000 to a number but I keep getting a conversion failed error.

    I think it's the thousandssepara tor that's giving me troubles but I have no idea how to tell sql that the string is a number formated a special way like I can do with date styles.

    Can anyone help me? Do I need to remove the thousandssepara tor before the convert/cast? And if so, how should I do that?

    Thanx

    PS. just to be clear, integer in the topic should be number/decimal (19,6)
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Try removing the comma using the REPLACE() function before you cast it into number.

    Good Luck!!!

    ~~ CK

    Comment

    Working...