title: Need to add 3 months to each value within a column, based on the 1st '3 Months' calculated off the Admission Date column in T-SQL
body: <p>I have 14K records table as the following (example of the data related to one particular client_id = 1002):
  (my date format is mm/dd/yyyy, months come first)</p>
  <pre><code>ClientsEpisodes:
  
        client_id      adm_date      disch_date    
            1002      3/11/2005        5/2/2005
            1002      8/30/2005       2/16/2007
            1002      3/16/2017            NULL
  </code></pre>
  <p>In SQL Server (T-SQL) - I need to calculate + 3 months date into the new column [3Month Date], where the 1st &quot;+ 3 months&quot; value will be calculated off my existing [adm_date] column. Then + 3 more months should be added to the value in [3Months Date], then the next 3 months should be added to the next value in the [3Months Date] column, and so on..., until [3MonthsDate] &lt;= [disch_date]. When [3Months Date] is more than [disch_date] then the data shouldn't be populated. If my [disch_date] IS NULL then the condition should be
  [3Months Date] &lt;= current date (whatever it is)  from GETDATE() function.</p>
  <p>Here is what I expect to see as a result:
  (I highlighted my dates offsets with different colors, for a better view)</p>
  <p><a href="https://i.stack.imgur.com/UaE80.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UaE80.jpg" alt="enter image description here" /></a></p>
  <p>Below, I'll clarify with more detailed explanation, about each populated (or not populated) data set:</p>
  <p>My first [adm_date] from ClientsEpisode table was 3/11/2005.
  Adding 3 months:
  3/11/2005 + 3 months = 6/11/2005 - falls AFTER the initial [disch_date] (5/2/2005)  - not populated</p>
  <pre><code>   Next [adm_date] from ClientEpisode is 8/3/2005 + 3 Months = 11/30/2005; 
          then + 3 months must be added to 11/30/2005 = 2/30/2006; 
          then 2/30/2006 + 3 months = 5/30/2006; 
          then 5/30/2006 + 3 months = 8/30/2006; 
          then 8/30/2006 + 3 months = 11/30/2006;
          then 11/30/2006 + 3 months = 3/2/2007 - falls AFTER my [disch_date] 
                                                        (2/16/2007) - not populated
  </code></pre>
  <p>the same algorithm for the next [adm_date] - [disch_date] sets 11/5/2007-2/7/2009 (in dark blue).</p>
  <p>then, where [adm_date] = 3/16/17, I have [disch_date] IS NULL, so, the algorithm applies until
  [3 Months Date] &lt;= current date (10/15/2020 in this case)</p>