title: How to convert hh:mm:ss to seconds in SQL Server with more than 24 hours
body: <p>I have table name <code>tblAttend</code> in which one column named <code>WorkHrs</code> is of datatype <code>varchar</code>.</p>
  
  <p>The result of simple select query is </p>
  
  <p><img src="https://i.stack.imgur.com/EqK2H.jpg" alt="enter image description here"></p>
  
  <p>I sum this column's value and get result in seconds my query is </p>
  
  <pre><code>select sum(DATEDIFF(SECOND, '0:00:00', WorkHrs )) 
  from tblAttend
  </code></pre>
  
  <p>and it shows this output:</p>
  
  <p><img src="https://i.stack.imgur.com/cKgYU.jpg" alt="enter image description here"></p>
  
  <p>Now the issue is, when sum of <code>WorkHrs</code> is greater than 24 hours it will throw an error:</p>
  
  <p><img src="https://i.stack.imgur.com/vVNgq.jpg" alt="enter image description here"></p>
  
  <p>What can you suggest to get around this problem? Thanks in advance</p>