if i have a filter like the following:
WHERE DATEDIFF(day, H.HitDate, getdate()) = 1
is this going to work over the new year? what i mean is, if i run the query on january 1st, will it get all the rows from december 31st the previous year (and day)?
any help is greatly appreciatedYes, it will.
Prove it to yourself by running this code:
DECLARE @.myThisYearDate datetime
DECLARE @.myNextYearDate datetimeSET @.myThisYearDate = '12/31/2003'
SET @.myNextYearDate = '01/01/2004'PRINT DATEDIFF(day,@.myThisYearDate,@.myNextYearDate)
Terri|||k, that seems to be working great.
thanks
No comments:
Post a Comment