title: How to convert decimal time to time in SQL Server 2008
body: <p>I have decimal time and I am not able to convert into time. </p>
  
  <pre><code>DECLARE @hours decimal(5,3) 
  SELECT @hours = 20.30 //20 Hrs and 30 mins  
  </code></pre>
  
  <p>I need the output in below format</p>
  
  <pre><code> Hours  20.5 AS Time (data type)
  </code></pre>
  
  <p>Below is my code</p>
  
  <pre><code>  select cast(hours /24 as datetime) 
  </code></pre>
  
  <p>this code gives output as 20.18 Hrs. However I need 20.5 hrs</p>