Quick Ref.
Functions
date
number
string
Data Types
date
number
string
Compatibility
HOUR(d)
Engine OK Alternative
mysql yes EXTRACT(HOUR FROM d)
oracle no TO_CHAR(d,'HH24')
postgres no EXTRACT(HOUR FROM (d)
sqlserver yes DATEPART(HOUR,d)

HOUR

HOUR allows you to retrieve the hour from a datetime.

 HOUR(d)

In this example you get the hour from the datetime field whn.


Results
See also: