View previous topic :: View next topic
|
Author |
Message |
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
I have a table called Table1 and it contains the DT_BIRTH column and the format is yyyy-mm-dd.Now I want to find out the age of the person as per the given unut date.
Example: person A has the value '1950-01-13' in the DT_BIRTH column and have to find out his age in yrs.
Can anyone please provide the query for this? |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Just give it to you? How will you learn anything that way?
Can you do this in a regular language? If so, then you know the algorithm.
Can you look for DB2 functions that might extract the parts of a date, and then maybe use subtractions, and then see what happens, and then adjust your code till it works. That's how whoever gives you the code did it. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
DB2 Basics: Fun with Dates and Times |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
|