Converting from String to Numeric Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gritbaby
    New Member
    • Sep 2006
    • 1

    Converting from String to Numeric Problem

    I have a SQL statement that keeps giving me this error:

    Error converting data type nvarchar to numeric.

    My select statement is the following:

    SELECT
    cast(Table.Stri ngValue as numeric(4))
    FROM
    Table
    WHERE
    cast(Table.Stri ngValue as numeric(4)) < 60

    The Table.StringVal ue has some null values as well as text like the word 'green' or 'yellow'. If I remove the where statement the SQL statement works. Is there something I need to do special to be able to use the cast statement within a where clause?
Working...