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