T-SQL Tutorial

Msg 155 Level 15 - Is not a recognized datepart option


On Transact SQL language the Msg 155 Level 15 - Is not a recognized datepart option means that the datepart option is misspelled or does not exist.

Msg 155 Level 15 Example:

Invalid select:

SELECT DATEPART(year224,'2014-09-06 15:41:23') as Year;

Message
Msg 155, Level 15, State 1, Line 1
'year224' is not a recognized datepart option.

Correct select:

SELECT DATEPART(YEAR,'2014-09-06 15:41:23') as Year;

Year
2014

Other error messages: