Date Only from SQL using Microsoft SQL Server

Here is quite a useful function for producing or saving only the date part of the smalldatetime datatype.

This can be useful if you only need to store the date or you need to group some results by date only.

SelectConvert([smalldatetime],floor(Convert([float],getdate(),(0))),(0))

Leave a Reply