title: SQL SELECT HH:MM - HH:MM
body: <p>I am trying to write an SQL query that will return the current time as follows:</p>
  
  <p>HH:MM - HH:MM (+1)</p>
  
  <p>E.g. if the time is 14:00 it would return 14:00 - 15:00</p>
  
  <p>I have managed to get as far as follows:</p>
  
  <pre><code>SELECT TOP (30) 
      DATEADD(HOUR, DATEDIFF(HOUR, 0, QUEUE_TIME.QueueDate), 0) AS 'DateAdded',
      CAST(CONVERT(VARCHAR(2), DATEPART(HH, QUEUE_TIME.QueueDate), 108) AS VARCHAR(2)) + ' - ' + 
      CAST(CONVERT(VARCHAR(2), DATEPART(HH, QUEUE_TIME.QueueDate), 108) + 1 AS VARCHAR(2)) AS Interval, 
      QUEUE_TYPE.Name, QUEUE_TIME.QueueTypeId, 
      MAX(QUEUE_TIME.QueuedTimeInSec / 60) AS 'WaitingTimeInSec', 
      CAST(ROUND(AVG(QUEUE_TIME.FlowRateWhenJoinedPerMin), 1) AS numeric(36, 2)) AS AvgFlowRate
  FROM
      QUEUE_TIME 
  INNER JOIN
      QUEUE_TYPE ON QUEUE_TIME.QueueTypeId = QUEUE_TYPE.Id
  WHERE
      (QUEUE_TIME.QueueDate &gt;= '11/07/2014 00:00') 
      AND (QUEUE_TIME.IsFreeFlowing = '0') 
      AND (QUEUE_TIME.QueueTypeId = '3')
  GROUP BY 
      DATEADD(HOUR, DATEDIFF(HOUR, 0, QUEUE_TIME.QueueDate), 0), 
      DATEPART(HOUR, QUEUE_TIME.QueueDate), QUEUE_TYPE.Name, QUEUE_TIME.QueueTypeId
  ORDER BY 
      'DateAdded'
  </code></pre>
  
  <p>This will return as follows, e.g. if it is 8am it will return 8-9. But i need it to be in the format 08:00 - 09:00.</p>
  
  <p>Any assistance would be appreciated.</p>
  
  <p>I am using SQL Server 2008.</p>
  
  <p>Thanks</p>