title: Date difference (in years) incl. year fraction
body: <p>Is there a simple way to calculate the difference between two dates that:</p>
  
  <ol>
  <li>expresses it as the number of years incl. the year fraction; and</li>
  <li>takes account of leap years?</li>
  </ol>
  
  <p>For example, the difference between 1st March 2011 and 1st March 2012 is 1 year.  However, if I use DATEDIFF(day,..,..) and divide by 365 I get an (undesirable) answer of 1.00274 because of the leap year.</p>
  
  <p>To be clear, I need any year fraction as well (ie. not just the whole number of years).  For example the difference between 1st March 2011 and 3rd March 2012 is 1.005479 (1 year + 2/365 years).  The difference between 1st March 2011 and 29th February 2012 is 0.997268 (0 year + 365/366 years)</p>
  
  <p>So, in summary, the output (in DECIMAL(7,6)) from the above two examples would be:</p>
  
  <p>1.000000
  1.005479
  0.997268</p>