Get Date From DateTime Field (SQL Server)

While writing SQL Server queries, often I need to extract date part from DateTime columns/variables and it’s very easy to do that:

SELECT convert(varchar,getdate(),101)

Bonus: How To Retrieve Time Part Alone From DateTime Field

Here is the bonus tip to get the time part alone from DateTime fields

SELECT convert(varchar,getdate(),108)

Hope this helps you.

3 thoughts on “Get Date From DateTime Field (SQL Server)”

Leave a Comment

Your email address will not be published. Required fields are marked *