MS SQL Show Only Date of Current Time

In MS SQL Server, we get the current time with the getdate() method. But this method gives us results with hours, minutes, seconds and milliseconds.

If we want to get the current time in year, month, day format only, the following query should be run.

SELECT CONVERT(date, getdate()) AS ourVarName


You May Interest

What are the INTERSECT Operators in SQL Server ?

Deleting Columns From a Table with a Query in MS SQL

What are Replication and Database Mirroring in SQL Server ?

What is the Maximum Number of Columns a Table in SQL Server ?

What is the XML Datatype in SQL Server ?