title: Query for last 8 week data
body: <p>This query is for last 6 months and I need the same query for last 8 week. If any particular week doesn't have data then it should return 0 count. I need 8 weeks data in 8 rows, each row will be having 7 days data. I am not able to write the query, so please help me!</p>
  
  <pre><code>select monthYear, COUNT([Report No])
  from
      (SELECT [Report No], monthYear=CONVERT(nvarchar(3), datename(month, CT_ReportedDate))+ ' ' + CAST(DatePart(YYYY, CT_ReportedDate) as nvarchar(4))
       FROM [Person].[dbo].[Reported_Crimes]
       where [CT_ReportedDate] &amp;lt;=  DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0)) AND [CT_ReportedDate] &gt;= DATEADD(MONTH, DATEDIFF(MONTH, -6, GETDATE())-6, 0) AND {CrimeName}
      ) as x
  group by monthYear
  order by DATEPART(MONTH,monthYear) asc
  </code></pre>