SQL Server : datetime comparison ignoring few milliseconds -


this question has answer here:

i noticed 2 datetimes considered equal if 1

2010-12-31 15:13:48.000  

and other

2010-12-31 15:13:48.001. 

i thought in beginning rounding or down nearest full seconds turned out

2010-12-31 15:13:48.002  

registers difference correctly.

any idea why happens?

the datetime data type accurate 3 milliseconds (0.0033 seconds), results make sense. values rounded 0.000, 0.003, , 0.007. so, first example rounded to: "2010-12-31 15:13:48.000" , second "2010-12-31 15:13:48.003".

you can read in documentation.


Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -