title: SQL Server 2008 - Difference between time(0)
body: <p>I've a table with <code>working_hours</code> <code>time(0)</code>, <code>lunch_hours</code> <code>time(0)</code>
  What I have to do is the following:</p>
  
  <p>If <code>lunch_hours</code> is greater that one hour, I have to calculate the offset</p>
  
  <p>Example:</p>
  
  <pre><code>lounch_hour = 01:30:00 =&gt; offset = 00:30:00
  </code></pre>
  
  <p>Once done I've to subtract the offset from the <code>working_hours</code> value</p>
  
  <p>Example:</p>
  
  <pre><code>offset = 00:30:00, working_hours = 07:30:00 =&gt; working_hours = 07:00:00
  </code></pre>
  
  <p>The result must be in <code>time(0)</code> format (<code>hh:mm:ss</code>)
  I've tried several solutions but still not working. Used <code>DATEDIFF</code> probably didn't used in correct way.</p>
  
  <p>Thanks for any help</p>