471,066 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

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:

cast(Table.StringValue as numeric(4))
cast(Table.StringValue as numeric(4)) < 60

The Table.StringValue 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?
Sep 20 '06 #1
0 2280

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Frederik Vanderhaeghe | last post: by
11 posts views Thread by Jean-François Michaud | last post: by
15 posts views Thread by allthecoolkidshaveone | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.