I am trying to implement this in a view, and i recieve this error, any idea how to fix it?
Msg 8114, Level 16, State 5, Line 2 Error converting data type varchar to numeric.
all the values are stored as varchar in the database.
I would take out all of the cast functions, and see which column has non-numeric value using the 'where isnumeric(C2)=0' function this returns all rows where C2 has a value that is not numeric and you can fix the errors or delete those rows if they definitely must be numeric.
Then in your main query add 'where isnumeric(C2)=1' and this will ensure that only numeric values are returned.
answered Apr 12, 2010 at 02:50 AM