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: strange function result

Re: strange function result

From: Gert Rijs <gem_at_wirehub.nl>
Date: 1997/02/10
Message-ID: <01bc171a$0d645900$565fa5c2@gertrijs>#1/1

hi,
i think your problem is that you don't have the (right) century stored in your bdate column. If you look at the 4th result column: bdate 20-jun-31, age -34 and interpret it as 20-jun-2031 then age -34 makes sense!

-- 
At Home: gem_at_wirehub.nl
At Work: gert.rijs_at_corp.ah.nl

Royce Medlock <medlocrf_at_dunx1.ocs.drexel.edu> wrote in article
<5djiae$i8k_at_noc2.drexel.edu>...

> I have created the following function:
>
> create or replace function AGE(a_bdate employee.bdate%type)
> return INT IS
> age INT;
> Begin
> select trunc(MONTHS_BETWEEN(SYSDATE, BDATE)/12) into age
> from employee
> where bdate = a_bdate;
> RETURN age;
> END AGE;
>
> here is some sample data I get when I use it:
>
> BDATE AGE
> --------- ----------
> 09-JAN-55 42
> 15-SEP-52 44
> 19-JUL-58 38
> 20-JUN-31 -34
<snip>
Received on Mon Feb 10 1997 - 00:00:00 CST

Original text of this message

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