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 -> problem with date in oracle 10g

problem with date in oracle 10g

From: Roberto Nenni <rnennix_at_xeim.it>
Date: Tue, 18 Dec 2007 20:30:53 +0100
Message-ID: <47681fee$0$16030$5fc30a8@news.tiscali.it>


Hi to everybody and sorry for my english

i have a problem with a query in a comparison of date it seems that oracle fails in comparring two date in a function this is the function:
CREATE OR REPLACE FUNCTION whr_DtMin (
 DATA1 DATE,
 DATA2 DATE )
 RETURN DATE
 DETERMINISTIC
 AS
 BEGIN
  IF (DATA1 IS NULL AND DATA2 IS NULL)
  THEN
   RETURN NULL;
  END IF;
  IF (DATA2 IS NULL OR DATA1 < DATA2)
  THEN
   RETURN DATA1;
  ELSE
   RETURN DATA2;
  END IF;
 END; it must return the minimum date between the two received as parameters

sometimes the functions don't work and return the wrong date

i use it in a query like this:
select field,field
,whr_dtMax(a.dtiniz,c.dtinmeCo) dtiniz
,whr_dtMin(a.dtfine,c.dtfimeCo) dtfine
,field,field

from tablea a
join tablec c etc...

can anybody help me?

tia
roberto nenni Received on Tue Dec 18 2007 - 13:30:53 CST

Original text of this message

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