From: yong321@yahoo.com
Subject: Re: Date function question
Date: 2000/03/03
Message-ID: <89os9l$nuj$1@nnrp1.deja.com>#1/1
References: <89op0a$k27$1@nntp3.atl.mindspring.net>
X-Http-Proxy: 1.0 x30.deja.com:80 (Squid/1.1.22) for client 12.31.208.162
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Fri Mar 03 17:20:58 2000 GMT
X-MyDeja-Info: XMYDJUIDy0h8797
Newsgroups: comp.databases.oracle.server
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; CSC)


select to_char(sysdate,'yyyy')-to_char(dob,'yyyy') age
from emp;

Yong Huang

(yong321@yahoo.com)
(http://www.stormloader.com/yonghuang/)


In article <89op0a$k27$1@nntp3.atl.mindspring.net>,
  "Abey Joseph" <abeyj@netzero.net> wrote:
> I am writing a report that shows a bunch of customer data.  I need to
> extract the exact age of the customer.  I am not sure if there is an
 Oracle
> function that will give me the exact age.  I subtracted the
 date_of_birth
> from the sysdate and I get the number of days in between.  How can I
 then
> translate that to years and months? I can divide the days by 365, but
 the
> margin of error gets bigger, the older the customer is.  Any help is
> appreciated.
>
> Abey Joseph
> abeyj@netzero.net


Sent via Deja.com http://www.deja.com/
Before you buy.


