title: Need to write recursive date function in sql?
body: <p>I'm having one holiday table based on that I need to return last working date.</p>
  
  <pre><code>Table_holiday
  
  Id Date        Text
  1  2013-03-29  Good Friday
  2  2013-05-01  Maharashtra day
  3  2013-05-02  Holiday 
  </code></pre>
  
  <p>When I execute my <code>date_recursive</code> function it should have to check and return me <code>last_business</code> date</p>
  
  <p><code>For example</code></p>
  
  <p>If I execute it on <code>@date datetime = '2013-03-29'</code> it should return me <code>last working date '2013-03-28'</code>as this is the last working date</p>
  
  <p>any help m newbie in sql.</p>