converting char to int question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmorand
    New Member
    • Sep 2007
    • 219

    #1

    converting char to int question

    I have a field which is a char type, but generally will contain numbers. I want to convert this to an int datatype so that I can perform mathematical expressions on it. The problem I'm running into is that sometimes people are entering non-numerical data into this field. Is there a way that I can strip off the non-numerical data so I only have the numbers?
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Yes.

    But you may want to consider if the value on the columns is accurate in the first place. You might have to parse the value of the column.

    You may use these functions:

    ISNUMERIC()

    http://msdn.microsoft. com/en-us/library/aa226054(SQL.80 ).aspx

    -- CK

    Comment

    Working...