Get All the dates of a specific month
DECLARE @dataforDate DATETIME, @month int SET @dataforDate=GETDATE() SET @month=DATEPART(MONTH,GETDATE()) DECLARE @t TABLE ( days DATETIME ) -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; WITH CTE_Days AS ( SELECT DATEADD(month, @month, DATEADD(month, -MONTH(@dataforDate), DATEADD(day, ...