I have a decimal (15,10) column that contains the OLE date creation date format. And when you execute a query like
SELECT * FROM SOMETABLE WHERE RECORDTIMEOA BETWEEN 41667 AND 41667.9999999999
the query returns all results after 8 or 9 seconds. But instead of using the integer value 41667, you use 41667.0000000000, then the query returns all results in less than 1 second . This also happens when you put 9 or 8 characters in the second decimal part, for example
SELECT * FROM SOMETABLE WHERE RECORDTIMEOA BETWEEN 41667 AND 41667.99999999
I have a non-clustered index in this column, maybe this affects this problem, so I'm wondering what is the difference between the below queries, why does the first return in 8 seconds and the rest in less than 1 second?
SELECT * FROM SOMETABLE WHERE RECORDTIMEOA BETWEEN 41667 AND 41667.9999999999
SELECT * FROM SOMETABLE WHERE RECORDTIMEOA BETWEEN 41667 AND 41667.9999999
SELECT * FROM SOMETABLE WHERE RECORDTIMEOA BETWEEN 41667.0000000000 AND 41667.9999999999
, , .
UPDATE:


UPDATE: CAST
