Home » SQL & PL/SQL » SQL & PL/SQL » FIND AGE (ORACLE)
FIND AGE [message #601607] Fri, 22 November 2013 22:18 Go to next message
DUTTA@TARUN
Messages: 29
Registered: May 2013
Location: INDIA
Junior Member
HELLO,
I HAVE DATE OF BIRTH COLUMN IN MY TABLE ,BUT NOW I HAVE TO FIND AGE OF THE PERSON , I AM USING

SELECT year(Sysdatetime() - D_O_BIRTH) as Age FROM RESUME_MST FROM DUAL
BUT ITS NOR WORKING.NOW HOW CAN I FIND THE AGE IN YEARS.

REGARDS.
Re: FIND AGE [message #601608 is a reply to message #601607] Fri, 22 November 2013 22:24 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
DATE1-DATE2 = difference is days as unit of measure

  1* select round((sysdate-to_date('1970-11-22','YYYY-MM-DD'))/365) AGE FROM Dual
SQL> 
SQL> /

       AGE
----------
        43

Re: FIND AGE [message #601618 is a reply to message #601607] Sat, 23 November 2013 00:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

How to get the difference between 2 dates in format years/months/days
Re: FIND AGE [message #601629 is a reply to message #601608] Sat, 23 November 2013 05:11 Go to previous message
DUTTA@TARUN
Messages: 29
Registered: May 2013
Location: INDIA
Junior Member
THANKS.
Previous Topic: "%s: invalid identifier" during Over(Partition by..)
Next Topic: Procedure to compare date and time separately
Goto Forum:
  


Current Time: Thu Apr 25 12:01:45 CDT 2024