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()))

Author: Brian Cline

Brian is a programmer living in Niagara Falls with ten years of development experience. He is passionate about automation, business process re-engineering, and gamification. For the last six years or so, he has been working with Salesforce and JavaScript.

Related Posts

Sharing is Caring