views:

228

answers:

2

I can extract the month and day by using Day(Date()), Month(Date()). I cant extract hours, with HOUR(Date()). I get the following error.

'HOUR' is not a recognized built-in function name.

How can I extract hours?

+2  A: 

SELECT DATEPART(hh, GETDATE());

Dave Markle
good god you are also using (loband) :)
TheVillageIdiot
(lowband) is made of 100% pure jesus. it's wonderful compared to the bloat of regular MSDN! ;-)
Dave Markle
A: 

Use datepart.

E.g.:

datepart(hh, date)
Adrian Godong