I have the following query returns resulting me Null or Zero:
SELECT TOP 1 ISNULL([jul-12],0) FROM Table_tmp
WHERE ID = 123250838
but when I add a condition asking if the column value is zero causes overflow error:
SELECT TOP 1 ISNULL([jul-12],0) FROM Table_tmp
WHERE ID = 123250838
AND [jul-12] <> 0
The data type of the column is FLOAT
exec sp_help 'Table_tmp'
jun-12 float no 8 53 NULL yes (n/a) (n/a) NULL
I tried with the functions CONVERT () and CAST () but with the same result.
But when the value of the column [Jul-12] is nonzero, it works without errors. Why does this happen?