Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> problem with date in oracle 10g
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
![]() |
![]() |