SQL Server – Get Only the Date


Sharing is Caring

Very often, I need the date of some data and do not like to convert the date to a varchar and then proceed to format it or convert it back to a date.

One of the official Microsoft sanctioned ways is:
SELECT DATEADD(dd,0,DATEDIFF(dd,0,GETDATE()))

Sharing is Caring