0

When using getdate() I'm getting, for example, 2014-04-23 15:51:31.763.

I want to have 2014-04-23 00:00:00.000

How can I achieve that?

eugene.it
  • 417
  • 3
  • 13
  • 32
  • http://www.sqlperformance.com/2012/09/t-sql-queries/what-is-the-most-efficient-way-to-trim-time-from-datetime & http://www.sqlperformance.com/2012/10/t-sql-queries/trim-time – Aaron Bertrand Apr 23 '14 at 20:06

2 Answers2

0

A Similar Question has been posted and answered:

How to return the date part only from a SQL Server datetime datatype

However, to achieve your exact desire:

select convert(datetime, CONVERT(date,getdate()))

Community
  • 1
  • 1
isasto
  • 49
  • 3
-2

change it to simpledate format as yyyy-mm-dd and then convert it back to yyyy-mm-dd-xx:xx:xx:xxx then the timestamp will be removed and resetted to zero

Jose
  • 11
  • 1