How to select date without time in SQL

Neeraj picture Neeraj · Feb 26, 2011 · Viewed 681.8k times · Source

When I select date in SQL it is returned as 2011-02-25 21:17:33.933. But I need only the Date part, that is 2011-02-25. How can I do this?

Answer

Prad9 picture Prad9 · Nov 17, 2011

For SQL Server 2008:

Convert(date, getdate())  

Please refer to https://docs.microsoft.com/en-us/sql/t-sql/functions/getdate-transact-sql