Dates

Download sql-server eBook

Syntax

  • EOMONTH (start_date [, month_to_add ] )

Remarks

as per https://msdn.microsoft.com/en-us/library/ms187819.aspx, DateTimes are only precise to 3ms.

Rounding of datetime Fractional Second Precision datetime values are rounded to increments of .000, .003, or .007 seconds, as shown in the following table.

User-specified valueSystem stored value
01/01/98 23:59:59.9991998-01-02 00:00:00.000
------------
01/01/98 23:59:59.9951998-01-01 23:59:59.997
01/01/98 23:59:59.996
01/01/98 23:59:59.997
01/01/98 23:59:59.998
------------
01/01/98 23:59:59.9921998-01-01 23:59:59.993
01/01/98 23:59:59.993
01/01/98 23:59:59.994
------------
01/01/98 23:59:59.9901998-01-01 23:59:59.990
01/01/98 23:59:59.991
------------

If more precision is required, time, datetime2 or datetimeoffset should be used.

Related Examples

Stats

399 Contributors: 18
Thursday, June 8, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook