Aggregate interval data to hourly
You can do a simple GROUP BY with DATEPART applied to the time column. I'm assuming that you'll always get a row every 15 minutes and you don't need to worry about gaps in the data.

SELECT 
  code
, date_column AS [date]
, DATEPART(HOUR, time_column) AS hourly
, SUM(value) AS value
FROM test_table
GROUP BY
  code
, date_column
, DATEPART(HOUR, time_column);


The following references may be useful to you:


DATEPART (Transact-SQL)
GROUP BY (Transact-SQL)
SUM (Transact-SQL)