Don't hard-code like that. What about leap years? Code below uses only date math and works accurately in leap and nonleap years.DECLARE @currMonthNum INT, @lastDayMonth INTSELECT @currMonthNum = DATEPART(MONTH, GETDATE()), @lastDayMonth = DATEPART(DAY, DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)))SELECT @currMonthNum, @lastDayMonthGO--check different Feb datesDECLARE @getdate datetimeDECLARE @currMonthNum INT, @lastDayMonth INTSET @getdate = '20140210'SELECT @currMonthNum = DATEPART(MONTH, @getdate), @lastDayMonth = DATEPART(DAY, DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, 0, @getdate) + 1, 0)))SET @getdate = '20120210'SELECT @currMonthNum = DATEPART(MONTH, @getdate), @lastDayMonth = DATEPART(DAY, DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, 0, @getdate) + 1, 0)))SELECT @currMonthNum, @lastDayMonth