title: Return a zero value if there is no data found
body: <p>I am trying to create a query to pull the number of new clients/week over 3 months. In the weeks where there was no new customers, it doesn't return anything - I would like it to return a zero value. I understand I need to create a table of all the possible weeks. But I am having trouble understanding how to create the table and join it.</p>
  <pre><code>SELECT distinct COUNT(DISTINCT dbo.Quotes.qmpQuoteID) AS &quot;Qty of Quote Lines Won&quot;,
  MIN(OmpOrderDate) As &quot;WeekStarting&quot;
  
  FROM SalesOrders   
  Left Outer Join SALESORDERLINES On OMPSALESORDERID = OMLSALESORDERID 
  Left Outer Join QUOTELINES On OMLQUOTEID = QMLQUOTEID And OMLQUOTELINEID = QMLQUOTELINEID 
  Left Outer Join QUOTES On QMLQUOTEID = QMPQUOTEID left outer join organizations on dbo.Quotes.qmpCustomerOrganizationID = dbo.Organizations.cmoOrganizationID
  
  WHERE ompOrderDate &gt;= DATEADD(MOnth, -3, GETDATE())
   AND cmocustomerprospectdate &gt;= DATEADD(MOnth, -3, GETDATE())
  
  AND OMLQUOTEID &gt; 1
  
  Group By DATEADD(week, DATEDIFF(week, 0, ompOrderDate),0)
  Order by MIN(OmpOrderDate) ASC
  </code></pre>
  <p>Thanks in advance!</p>
  <p>this returns the results :
  <br>Qty of Quote Lines Won     Week Starting
  <br>1                           23/04/2020
  <br>1                           15/05/2020
  <br>2                           19/05/2020
  <br>1                           etc
  <br>2</p>
  <p>Ideally this would look like:
  <br>Qty of Quote Lines Won         Week Starting
  <br>1                            21/04/2020
  <br>0                           28/04/2020
  <br>0                           05/05/2020
  <br>1                           12/05/2020</p>
  <p>etc - many thanks - I'm sorry my formatting is terrible</p>