title: How to get the total spent hour per day
body: <p>I have a column here and I need to get the hour count per day (every succeeding hour +1)</p>
  
  <p><a href="https://i.stack.imgur.com/y4Xix.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y4Xix.png" alt="enter image description here"></a></p>
  
  <p>Expected Output:</p>
  
  <pre><code>Date       | HourSpent
  2017-12-08 | 6
  </code></pre>
  
  <p>My Code attempt:</p>
  
  <pre><code>SELECT Cast(TransDateTime as Date), DateDIFF(hour,MIN(TransDateTime),MAX(TransDateTime)) as DateTime 
  FROM GuestTransLedger where GuestExtID = '2016-120-5624873' 
  GROUP BY Cast(TransDateTime as Date) ORDER BY 1 DESC
  </code></pre>