A director s term ends in a given year, but at no given time of year; depends on the yearly meeting.
I thought I would try YEAR to record it--but, in spite of <a href="http://dev.mysql.com/doc/refman/5.5/en/year.html" title="http://dev.mysql.com/doc/refman/5.5/en/year.html">http://dev.mysql.com/doc/refman/5.5/en/year.html</a> , simply assigning NOW() to such a type does not work. There is also no implicit conversion to DATE. All in all, it behaves as a small integer, not a time type. For my end it is much less good than 'year-00-00', something already slightly obscure.
Comments
RE: YEAR and time types
By Rick James at 07/23/2012 - 14:54mysql> SELECT YEAR(NOW());
+-------------+
| YEAR(NOW()) |
+-------------+
| 2012 |
+-------------+
mysql> SELECT CONCAT('2012', '-01-01');
+--------------------------+
| CONCAT('2012', '-01-01') |
+--------------------------+
| 2012-01-01 |
+--------------------------+
To show that it acts like a DATE:
mysql> SELECT CONCAT('2012', '-01-01') - INTERVAL 1 day;
+-------------------------------------------+
| CONCAT('2012', '-01-01') - INTERVAL 1 day |
+-------------------------------------------+
| 2011-12-31 |
+-------------------------------------------+
RE: YEAR and time types
By hsv at 07/24/2012 - 11:20mysql> SELECT CONCAT('2012', '-01-01');
+--------------------------+
| CONCAT('2012', '-01-01') |
+--------------------------+
| 2012-01-01 |
+--------------------------+
To show that it acts like a DATE:
mysql> SELECT CONCAT('2012', '-01-01') - INTERVAL 1 day;
+-------------------------------------------+
| CONCAT('2012', '-01-01') - INTERVAL 1 day |
+-------------------------------------------+
| 2011-12-31 |
+-------------------------------------------+
<<<<<<<<
No: I mean variables of type YEAR