title: How to get a list of months and year between two dates in SQL Server
body: <p>I have to get the list of months and year in between my dates. Currently it only returns month and year for dates that has data associated with it. </p>
  
  <p>for example my dates is between: <code>'8'+'/1'+'/'+'2015' and DATEADD(mm, 15, '8'+'/1'+'/'+'2016'</code></p>
  
  <p>It only prints out: May2016, June2016, July2016, Auguest2016, September2016</p>
  
  <p>I want it to print out all of the months and year in between. Here is my sql queries: </p>
  
  <pre><code>select d.id_base as case_id, 
      c.C_LAST_ACTION AS Docketed,
      c.C_CASE_TYPE AS caseType,
      ct.C_NAME As caseName, 
      ct.C_DESCRIPTION AS caseNameDescription,
     case when d.c_mod_decision_id is not null then '' else  DATENAME(mm, d.c_issue_date) + DATENAME(yyyy, d.c_issue_date)  end as display
  from t_case_decision d JOIN T_CASE_INPUT c on c.id = d.id_base JOIN T_CASE_TYPE ct on C_CASE_TYPE = ct.id 
  where cast(d.c_issue_date AS date) BETWEEN '8'+'/1'+'/'+'2015' and DATEADD(mm, 15, '8'+'/1'+'/'+'2016') 
  </code></pre>