Extracting hours from a DateTime (SQL Server 2005)
... you can use it on any granularity type i.e.:
DATEPART(YEAR, [date])
DATEPART(MONTH, [date])
DATEPART(DAY, [date])
DATEPART(HOUR, [date])
DATEPART(MINUTE, [date])
(note: I like the [ ] around the date reserved word though. Of course that's in case your column with timestamp is labeled "date")
SELECT DATEPART(HOUR, GETDATE());
DATEPART
documentation
Use datepart.
E.g.:
datepart(hh, date)