Reputation: 57
I have a column in my table Employee
called BirthYear
which stores only the year of birth and not the entire birthdate. I need to calculate the age of every employee using only the BirthYear
data in SQL Server. How do I do it?
Upvotes: 1
Views: 90
Reputation:
Here's your query to compute age
select DATEPART(year, getdate()) - BirthYear from Employee
Upvotes: 3