Reputation: 23
I made this query which select the date in column, now i want to get the year only from selected date .
SELECT column_Name
FROM table_name
WHERE column_name = STR_TO_DATE( '00/00/0000', '%m/%d/%Y' )
Please solve this problem.
Upvotes: 1
Views: 171
Reputation: 4446
The ans of this unclear question should be
SELECT YEAR(STR_TO_DATE( '00/00/0000', '%m/%d/%Y' )) as date from table_name
you should get help fron it
http://dev.mysql.com/doc/refman/5.0/en/date-calculations.html
Upvotes: 1