title: Drop down list of month and year for parameter in SQL Server
body: <p>I would like to display month and year for my parameter for the end users to select from the drop down list. </p>
  
  <p>For example the startdate has to be June 2017 and enddate is only month and year from <code>getdate()</code> </p>
  
  <p>This is the query that I wrote but it's not working for me</p>
  
  <pre><code>declare @start datetime = '6/1/2017'
  declare @end datetime = getdate()
  
  select 
      @start = dateadd(M, @start), 
      datename(M, @start) + ' ' + datename(Y, @start)
  where 
      @start &lt; @end
  </code></pre>