I wanted to remove/ignore the seconds and milliseconds coming from GETDATE() SQL function. When I executed,
SELECT GETDATE()
output will be like
2015-01-05 14:52:28.557
I wanted to ignore seconds and milliseconds from above output. What is the optimize and best way to do this?
I have tried to do this by typecasting like this:
SELECT CAST(FORMAT(GETDATE(),'yyyy-MM-dd HH:mm:0') AS datetime)
Is it is the correct and optimize way to do this?