sql server getdate add hours code example
Example 1: get hour from date sql
SELECT DATEPART(HOUR, GETDATE());
Example 2: SQL server select to get sum of hours
SELECT DATEADD(ms, SUM(DATEDIFF(ms, '00:00:00.000', YourFieldName)), '00:00:00.000') as time FROM YourTableName