Вопросы и ответы для программистов
DECLARE @CutoffDate datetime SET @CutoffDate = dateadd(month, -6, GETUTCDATE()) select DATEFROMPARTS(year(CreationDate), month(CreationDate), day(CreationDate)) as [Date] , count(*) from Posts where ParentId is null and CreationDate > @CutoffDate group by year(CreationDate), month(CreationDate), day(CreationDate) order by year(CreationDate), month(CreationDate), day(CreationDate) asc