Code:
	SELECT 
	        SUBSTRING_INDEX(birthday_search, '-', 1) AS bday_year
	FROM 
	        user
	WHERE 
	       birthday_search <> '0000-00-00'
What I want to do is select all users who are older than 18 from my user table. Ignoring the terrible database design of storing birthdays in the format YYYY-MM-DD which is not my doing, I have managed to get the year from this string. But as it's not a number when I try and do calculations on it, it screws up.

Any ideas how to get bday_year as an integer. Then I can just take it away from the current year to find out the age