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

How is Sqlcmd Different from Osql ?

What is SQL Profiler ?

Using CASE WHEN in MS SQL

What is the Difference Between a Local and a Global Temporary Tab ...

What are the System Data Collection Sets Predefined Inside SQL Se ...