Microsoft SQL Server Dates

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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.



Got any Microsoft SQL Server Question?