Subscribe to our YouTube Channel for more Videos

SQL Server 101 – Get the Date part from DateTime


You can use the convert function in SQL Server to retrieve only the date part from the date time.

How to get the Date part from DateTime variable in SQL Server ?

Here’s a sample code snippet demonstrating how to do it.

SELECT CONVERT(DATE, GETDATE())

The GETDATE returns the current date along with the time and the convert function extracts only the DATE part of it.

Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.