When running the SQL query:
select GETDATE()
I get the below output:
2017-10-26 12:48:41.273
It displays the date and the time. But I want the output as
2017-10-26 00:00:00
How to get such a date format?
When running the SQL query:
select GETDATE()
I get the below output:
2017-10-26 12:48:41.273
It displays the date and the time. But I want the output as
2017-10-26 00:00:00
How to get such a date format?
Try below :
SELECT CONVERT(DATETIME,CONVERT(VARCHAR(12),GETDATE(),112))
Result :
2017-10-26 00:00:00.000
SQL Server 2012 and later versions
SELECT FORMAT(GETDATE() , 'yyyy/dd/MM HH:mm:ss')
Result
for either of the above it would return:
10/16/2013 17:00:20