这是我的 SQL 查询:
SELECT (CAST(CAST([rssi1] AS float) AS INT))*-1, CONVERT(VARCHAR(10), [date], 110)
FROM history
WHERE id IN
(
SELECT TOP 8 id
FROM history
WHERE ([siteName] = 'CAL00022')
ORDER BY id DESC
)
ORDER BY date ASC
大多数时候,它工作正常。有时,我收到此错误:
Server Error in '/' Application.
Error converting data type nvarchar to float.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Error converting data type nvarchar to float.
表是这样的: