content_image/784914.jpg content_image/784912.jpg content_image/784911.jpg content_image/784910.jpg
•For a number consisting of one or two digits, or for a string which can be interpeted as such a number, return a YEAR  value as follows: 

•If the number is in the range 1-69 inclusive, add 2000 and return the sum. 

•If the number is in the range 70-99 inclusive, add 1900 and return the sum. 

•For a string which evaluates to 0, return 2000. 

•For the number 0, return 0. 

•For a DATE , DATETIME , or TIMESTAMP  value, return the YEAR  portion of the value. For a TIME value, return the current year. 

If you do not specify the type of a TIME  argument, you may get a different result from what you expect, as shown here: 

mysql> SELECT CONVERT("11:35:00", YEAR), CONVERT(TIME "11:35:00", YEAR); 

<img src='content_image/784914.jpg'>

•If the argument is of type DECIMAL , DOUBLE , DECIMAL , or REAL , round the value to the nearest integer, then attempt to cast the value to YEAR  using the rules for integer values, as shown here: 

mysql> SELECT CONVERT(1944.35, YEAR), CONVERT(1944.50, YEAR); 

<img src='content_image/784912.jpg'>

1 row in set (0.00 sec) 

mysql> SELECT CONVERT(66.35, YEAR), CONVERT(66.50, YEAR); 

<img src='content_image/784911.jpg'>

1 row in set (0.00 sec) 

•An argument of type GEOMETRY  cannot be converted to YEAR . 

•For a value that cannot be successfully converted to YEAR , return NULL . 

A string value containing non-numeric characters which must be truncated prior to conversion raises a warning, as shown here: 

mysql> SELECT CONVERT("1979aaa", YEAR); +--------------------------+ | CONVERT("1979aaa", YEAR) | +--------------------------+ | 1979 | +--------------------------+ 1 row in set, 1 warning (0.00 sec) 

mysql> SHOW WARNINGS; 

<img src='content_image/784910.jpg'>

