Forum Moderators: open
I am continually getting the error message : [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to numeric.
When trying to run this SQL statement :
SELECT * FROM table WHERE CAST(Field1 AS DECIMAL(10,1)) >= 1
Field1 is Varchar(3) with data such as 3.5 or 4 in it (it is a rating system).
Any ideas?
Can't tell right away why the error, but a thought - if you are storing numeric data in the field, why not make it a decimal datatype from the get go? That would avoid the cast argument.
The error could come from the DB trying to convert a null, or a non-numeric value.