title: Add Particular day, year, month, week in particular date using sql server
body: <p>I am stuck in one query. Need your help.</p>
  
  <p>I have table tblEventCalendarEvents</p>
  
  <pre><code>id    name      start_date   end_date    rec_type
  891 Bob Lehman  2012-05-01   2099-02-01  0_2_1_1
  892 Bob Lehman  2012-11-01   2099-02-01  1_4_3_1
  893 Bob Lehman  2012-05-03   2099-02-01  0_0_2_2
  </code></pre>
  
  <p>I want to do such task. I want such record in which if today is <code>between startdate and enddate</code> also based on rec type.</p>
  
  <p>In RecType Filed value is store like <code>0_2_1_1</code> mean this event repeat on every second month, first week and third day.</p>
  
  <p>So if event start on 2012-05-01 mean 1st May, 2012 so now that event repeat on such a date which fulfill repeat condition like then it will repeat on every two month so next month is July, 1st week and 3rd day mean next repeat date is 2012-07-03 3rd July,2012.</p>
  
  <p>So it will repeat on </p>
  
  <pre><code>2012/07/01
  2012/09/02
  2012/11/04
  2013/01/06
  </code></pre>