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