Hey I am trying to convert the data type from varchar to float of the column name 'Identification'. Below are the queries that I have created and both are throwing the error
Select distinct Convert(float,(Replace([Identification], '-',''))) FROM [A]
where identification is NOT Null;
Select Cast(Replace([Identification], '-','') AS FLOAT) FROM [A]
where identification is NOT Null;
Error Msg:
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.
TRY_CAST/TRY_CONVERT, which really hinders fixing your data. - Larnu(n)varcharis a bad idea, and you need to fix your design. Unfortunately, like I mentioned, as you're using unsupported software you can't useTRY_CONVERT; personally I would suggest you really look at those upgrades now. - Larnu