calculate age in year, month and days [message #207604] |
Wed, 06 December 2006 03:26 |
iriswancy
Messages: 17 Registered: December 2005 Location: Malaysia
|
Junior Member |
|
|
Hi..
Here's the function i have created to calculate age in year(s) and month(s)...
(dob_incorp_date in date)
return varchar2
as
yrs number(3);
mnths number(2);
str varchar2(20);
Begin
yrs:=floor(months_between(sysdate,dob_incorp_date)/12);
mnths:=mod(months_between(sysdate,dob_incorp_date),12);
str:=yrs||' '||'years'||' '|| mnths ||' '||'months';
return str;
end;
As above function, any idea how to include to calculate the age in day(s) also?
Pls help.
Thanks & Regards,
Iris
|
|
|
|