954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

generating age

hello experts...
i have a table employee and in it are attributes like name gender,birthdate...etc..
apart from this i want to automatically generate d employees age from d current date....how can it be done??
thankyou...

dewyShaikh
Newbie Poster
4 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

a simple subtraction of birthdate from sysdate will do the trick for you.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

maybe something like this will do the trick

select round(to_number(sysdate-birthdate)/365) age from test_birthdate;


as previously mentioned, sysdate minus birthdate and divided by 365 days in year.

dzen
Newbie Poster
7 posts since Jan 2010
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: