在SQL中获取错误将数据类型varchar转换为float时出错

时间:2023-01-28 11:09:59

i am using below statement to extract the data but getting error as 'Error converting data type varchar to float.'

我使用下面的语句来提取数据,但得到错误为'错误将数据类型varchar转换为浮动。

select Docket_No, Order_No, Ven_cd, Ven_name, Order_Type, DSP, Manifest_Id, Order_Date, Inv_Out_Date from ORDERDATA 
WHERE Docket_No = '123456'

Please help me

请帮帮我

I am using SQL server management 2016

我正在使用SQL Server管理2016

1 个解决方案

#1


0  

I have come across this issue. In this case, SQL knows that its(docket_no) of float data type. When you try to concatenate the a float value to a string this error occurs.

我遇到过这个问题。在这种情况下,SQL知道它的(docket_no)float数据类型。当您尝试将浮点值连接到字符串时,会发生此错误。

If you can specify, how you have done the concatenation then i will try to tell where the error occurs.

如果你可以指定,你如何完成连接,那么我将尝试告诉错误发生的位置。

Thanks

谢谢

#1


0  

I have come across this issue. In this case, SQL knows that its(docket_no) of float data type. When you try to concatenate the a float value to a string this error occurs.

我遇到过这个问题。在这种情况下,SQL知道它的(docket_no)float数据类型。当您尝试将浮点值连接到字符串时,会发生此错误。

If you can specify, how you have done the concatenation then i will try to tell where the error occurs.

如果你可以指定,你如何完成连接,那么我将尝试告诉错误发生的位置。

Thanks

谢谢