At 03:24 PM 12/17/2004, you wrote:
Does anyone know what Column Type the result of the Year() function is?

In other words, if I execute:

select Year(Hiredate) as mycolname
from mytable;

is the result a smallint? a char()? a varchar()?

Unfortunately, the manual doesn't say and I can't think of a quick way to
figure it out....

Rhino,

http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html
YEAR(date)
Returns the year for date, in the range 1000 to 9999.

mysql> SELECT YEAR('98-02-03');
        -> 1998


My guess is the result would be SmallInt. You know it is not string because the result is right justified (a string would be left justified).



Example: select year(current_date);


I don't know if this following link applies or not, because the value returned apparently is 1000 to 9999http://dev.mysql.com/doc/mysql/en/YEAR.html



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to