troubleshooting Question

SQL Need to calculate age from DOB, no stored procedures or functions or views

Avatar of Charles Baldo
Charles BaldoFlag for United States of America asked on
Microsoft SQL ServerMicrosoft SQL Server 2005
3 Comments1 Solution253 ViewsLast Modified:
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

Thank You
ASKER CERTIFIED SOLUTION
Arana (G.P.)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros