T-SQL Query Returning Items It Shouldn't Be

前端 未结 5 891
遥遥无期
遥遥无期 2021-01-21 17:15

Here\'s the scenario. The column in question is called \'datein\' and it\'s type is \'datetime\'. I have three rows with the value of \'2009-10-01 00:00:00.000\' for \'datein\

5条回答
  •  生来不讨喜
    2021-01-21 17:55

    According to MSDN documentation

    Date and time data from January 1, 1753 through December 31, 9999, to an accuracy of one three-hundredth of a second (equivalent to 3.33 milliseconds or 0.00333 seconds). Values are rounded to increments of .000, .003, or .007 seconds, as shown in the table.

    From the given example in that page, you must end your query with .997 to obtain the results that you expect.

提交回复
热议问题