SQL Need to calculate age from DOB, no stored procedures or functions or views
I need to calculate age from today in years. The date is stored in a Varchar(255) type. It has a format like YYYY-mm-dd ex 1971-02-12. I am guaranteed it will always be a valid date. The database version is SQL 2005.
This must be in T-SQL I can not create a store procedure , function or view. It is part of an upgrade of an FDA validated database and can not create new. Don't like it but that's the government regulating. I know this is easier to do with a function, have down it before with functions. Do not have that ability at the moment