title: differences between dates in sql
body: <p>I have two columns namely enddate and startdate
  I need to find all those records where</p>
  
  <blockquote>
    <p>(enddate-startdate)>2 years</p>
  </blockquote>
  
  <p>I tried using <code>timediff(enddate,startdate)&gt;2</code></p>
  
  <p>But it returns an error saying : <strong><em>'timediff' is not a recognized built-in function name</em></strong></p>
  
  <p>I am using sql server management studio,  any help ?</p>
  
  <p>My date format is <code>2007-04-16 00:00:00.000</code></p>