title: T-SQL: Round to nearest 15 minute interval
body: <p>What's the best way to round an HH:MM value to the closest 15 minute interval?  I don't track seconds so they don't matter.</p>
  
  <pre><code>00:08:00 becomes 00:15:00 
  00:07:00 becomes 00:00:00 
  01:59:00 becomes 02:00:00 
  </code></pre>
  
  <p>and so on. Is there an elegant, non UDF or Case statement method for doing this?</p>
  
  <p><strong>EDIT:</strong> Here's the SQL I'm using to get the above values that I'd like to round:</p>
  
  <pre><code>CONVERT(CHAR(8), DATEADD(n, SUM(DATEDIFF(n, starttime, stoptime)), 0), 108)
  </code></pre>
  
  <p><code>starttime</code> and <code>stoptime</code> are SQL <code>datetime</code>s.</p>