LISTING 1: Code That Uses DATEDIFF() to Determine Whether You’ve Crossed a Datetime Boundary DECLARE @InputDate datetime SET @InputDate = '2001-11-29' --getdate() SELECT DATEDIFF ( mm , @InputDate, @InputDate + 1 ) GO DECLARE @InputDate datetime SET @InputDate = '2001-11-30' --getdate() SELECT DATEDIFF ( mm , @InputDate, @InputDate + 1 )