Transaction SQL Date Calculations – First Day of Month and Last Day of Month

I find that I am consistently trying to determine the first and last day of the current month using Transact SQL. The following is a cheat sheet for calculating easily those dates: DECLARE @today DATETIME, @first_of_month DATETIME, @last_of_month DATETIME   SET @today = GETDATE() SET @first_of_month = DATEADD(dd,-(DATEPART(dd, @today)-1),@today) SET @last_of_month = DATEADD(dd, –1, DATEADD(mm,…