title: What is the most accurate way of using DATEDIFF in SQL Server?
body: <p>I have two computed columns (MonthsInService and YearsInService) with the following expressions.</p>
  
  <p>MonthsInService = <code>(datediff(month,[DateEngaged],getdate()))</code></p>
  
  <p>YearsInService  = <code>(datediff(month,[DateEngaged],getdate())/(12))</code></p>
  
  <p>Now if for example DateEngaged = 2012-April-09 and getdate() is 2013-April-08, MonthsInService returns 12 and YearsInService is 1. </p>
  
  <p>My application requires that YearsInService be Zero since there is still one day to go before the employees first Anniversary.</p>
  
  <p>Am not even sure how to best handle the MonthsInService column since months have varying number of days.</p>