Thursday, May 07, 2009

BI-tch – Dropping the time in datetime

Sometimes door #1 isn’t the best option.

Option 3: DATEADD

DATEADD(dd, DATEDIFF(dd, 0 getdate()), 0)

Returns 2009-04-09 00:00:00.000 (shock horror!)

BI-tch

No comments: