Here are some things to help:declare @d datetime = Current_Timestampdeclare @firstOfMonth datetime = dateadd(month, datediff(month, 0, @d), 0)declare @lastOfMonth datetime = dateadd(day, -1, dateadd(month, 1, @firstOfMonth))declare @firstOfNextMonth datetime = dateadd(month, 1, @FirstOfMonth)select @d, @firstOfMonth, @lastOfMonth, @firstOfNextMonth
For your query, I'd probably do something like this:select ...where myDateColumn >= @firstOfMonth and myDateColumn < @firstOfNextMonth