For SQL Server 2008 and higher versions, you can CONVERT to date:
SELECT CONVERT (date, getdate())
Are you interested in learning SQL from scratch! Have a look at this interesting video on SQL provided by Intellipaat:
For older versions, you can use the following:
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, @your_date))
For Example
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
Output:
2019-06-22 00:00:00.000
Pros:
- varchar<->datetime conversions are not required.
- No need to use locale as well.