title: difference in time is giving incorrect results
body: <p>I have a table as test</p>
  
  <pre><code>shiftend            |        out            |       
  ---------------------------------------------   
  15:00:00.0000000    |   2016-07-22 14:42:00 |   
  16:00:00.0000000    |   2016-07-22 16:06:00 |       
  </code></pre>
  
  <p>Shiftend is having a datatype as time
  out is having a datatype as smalldatetime</p>
  
  <p>I am expecting the output as</p>
  
  <pre><code>shiftend            |         out           |   Output    
  -----------------------------------------------------------------------------   
  15:00:00.0000000    |   2016-07-22 14:42:00 |   -00:18:00   
  16:00:00.0000000    |   2016-07-22 16:06:00 |    00:06:00   
  </code></pre>
  
  <p>I am trying this query:</p>
  
  <pre><code>select shiftend,out,CAST((out-Shiftend) as time(0)) as Output from test
  where 
  CAST(CONVERT(NVARCHAR(10), out, 101) AS SMALLDATETIME) = CAST(CONVERT(NVARCHAR(10),'2016-07-22', 101) AS SMALLDATETIME)
  </code></pre>
  
  <p>But i am getting the output as</p>
  
  <pre><code>shiftend            |   out                 |     Output    
  -----------------------------------------------------------------------------   
  15:00:00.0000000    |   2016-07-22 14:42:00 |    23:42:00   
  16:00:00.0000000    |   2016-07-22 16:06:00 |    00:06:00   
  </code></pre>
  
  <p>23:42:00 is incorrect. How to calcualte the time.</p>