title: SQL Server - Mondays date based on week number and year (view)
body: <ol>
  <li>I have a table that specifies the current year (done in C#) <code>Years.Year</code></li>
  <li>I have a table called Weeks which contains the numbers (1-53)  <code>Weeks.WeekNumber</code> <a href="http://whatweekisit.org/" rel="nofollow">http://whatweekisit.org/</a></li>
  </ol>
  
  <p>Now from this I want to create a view which will list Monday's date of each week based upon the parameters <code>Years.Year</code> and <code>Weeks.WeekNumber</code></p>
  
  <p>the code below gets the week number but doenst calculate the date correctly:</p>
  
  <pre><code>SET DATEFIRST 4     
  DECLARE @d DATETIME
  
  SET @d = GETDATE() 
  --BELOW IS WHAT I WANT TO WORK ALTHOUGH THE SUB QUERY RETURNS MORE THAN ONE VALUE
  --(SELECT Weeks.WeekNumber FROM Weeks)
  
  SELECT
    Weeks.WeekNumber,
    DATEADD(dd, (@@DATEFIRST + 5 + DATEPART(dw, @d)) % 7, @d) Monday
    FROM Weeks
  </code></pre>
  
  <p>Example data: </p>
  
  <pre><code>Week Number       Date
       1        29/12/2014
       2        05/01/2015
       3        12/01/2015
       4        19/01/2015
       5        26/01/2015
      ...           ...
      53        28/12/2015
  </code></pre>
  
  <p><strong>to Summarize:</strong></p>
  
  <p>the year 2015 contains 53 Mondays, so I am trying to generate a SELECT statement which will specify the week number, and the date for each week, just like the Example data above</p>
  
  <p>thanks for the help below, and the variety along with the suggestion of Calendar tables.... I will try and test all :)</p>