sql extract hour from date hour code example Example: get hour from date sql SELECT DATEPART(HOUR, GETDATE());