title: Calculate year week number from given period in VBScript
body: <p><strong>Scenario</strong>: Trying to find out the <strong>End Week Number</strong>(current year's week number) and <strong>Start Week Number</strong> using a given period. Suppose <strong>PeriodWeeks</strong> = 10. That means from today's week number  to last 10 weeks which surely will go to last year in current situation. </p>
  
  <p><strong>Code</strong> I have:</p>
  
  <pre><code>perdiodWeeks = 10             ' this is a constant in the code
  periodMonths= periodQtrs * 3  ' this calculates month from given number of quarters
  
  endDate = DateAdd("m",-1,Date)
  endYear = DatePart("yyyy", endDate)
  endMonth = DatePart("m", endDate)
  
  startDate = DateAdd("m", -(periodMonths-1), endDate)
  startYear = DatePart("yyyy", startDate)
  startMonth = DatePart("m", startDate)
  </code></pre>
  
  <p>How can I calculate the following? </p>
  
  <pre><code>startYW             ' start year week number
  endYW               ' end year week number
  </code></pre>
  
  <p>where value would be <strong>endYW</strong> = 201506 and <strong>startYW</strong> = perdiodWeeks from endYW. 06 is the current Week Number of 2015   </p>