Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Date function question

Re: Date function question

From: Abey Joseph <abeyj_at_netzero.net>
Date: 2000/03/03
Message-ID: <89pclv$g5p$1@slb1.atl.mindspring.net>#1/1

Yong,

            I am sorry about not phrasing my questions clearly. Your last message did point me to the solution. Thank you. I took your suggestion and ran my report and got the result I was looking for. It is a telemarketing report on our existing patients. The telemarketers thought it'd be a good idea to know how old the person they're calling (in case they're too young or too old) and also the proximity to the patients birthday (in case it was close to the patient's birthday!). They wanted an age field, since it'd take a little time to figure the age from the DOB. Thanks again.

Abey Joseph

<yong321_at_yahoo.com> wrote in message news:89p6q6$d8$1_at_nnrp1.deja.com...
> Abey,
>
> I guess I don't understand you. You mean it's incorrect in case the
> person is not born but is predicted to be born some time later?
>
> After I posted my message, I realized my query didn't really solve your
> problem because you also want to have month, not just year (i.e. a
> person born in 4/1998 is age 1 year plus 10 months, not 2 years). To do
> that, you probably have to do some calculation yourself:
>
> After select to_char(sysdate,'yyyy')-to_char(dob,'yyyy') yr, you
> select to_char(sysdate,'mm')-to_char(dob,'mm') mon. If mon>=0, simply
> report yr||' years and '||mon||' months old', else, report yr-1||'
> years and '||12+mon||' months old'.
>
> Yong Huang
>
> In article <89ou11$iot$1_at_nntp3.atl.mindspring.net>,
> "Abey Joseph" <abeyj_at_netzero.net> wrote:
> > This statement would give me an age that will be incorrect if the
 date and
> > month for DOB is > sysdate!
> >
> > <yong321_at_yahoo.com> wrote in message
 news:89os9l$nuj$1_at_nnrp1.deja.com...
> > > select to_char(sysdate,'yyyy')-to_char(dob,'yyyy') age
> > > from emp;
> > >
> > > Yong Huang
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Mar 03 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US