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

MS SQL Finding Which Tables a Column Name is In

Deleting Table With Query in MS SQL

How to Rebuild the Master Database in SQL Server ?

Using MS SQL COUNT

What is the Difference Between DB Mirroring and Log Shipping in S ...