SELECT GETDATE()
Returns: 2008-09-22 15:24:13.790
I want that date part without the time part: 2008-09-22 00:00:00.000
How can I get that?
datedatetimesqlsql-server-2008t-sql
SELECT GETDATE()
Returns: 2008-09-22 15:24:13.790
I want that date part without the time part: 2008-09-22 00:00:00.000
How can I get that?
Best Answer
NOTE: This answer returns the original
DATETIME
orDATETIME2
type. For an expression that returns a trueDATE
type (SQL Server 2008 and later), see BenR's answer below.for example
gives me
Pros: