Thursday, November 19, 2009

Sql server getdate() – set to midnight

a very short note on a particular use of getdate() to obtain the today’s date with hours minutes and seconds set to midnight (00:00:00):

select dateadd(day, datediff(day, 0, getdate()), 0)

No comments: