Wednesday, March 23, 2011

Setting DateTime Value to Zero

--using DATEDIFF can set the time portion of your DateTime value to zeros --Handy!

DECLARE @Day DATETIME

SET @Day = DATEADD(DAY, -7, DATEDIFF(Day, 0, GETDATE()))

No comments:

Post a Comment