Returns the value of part of a datetime value.
DATEPART( date-part, date-expression )
date-part The date part to be returned. For a complete listing of allowed date parts, see Date parts.
date-expression The date for which the part is to be returned.
The date must contain the date-part field.
SQL/2003 Vendor extension.
The following statement returns the value 5.
SELECT DATEPART( month , '1987/05/02' );