OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
RE: date difference

From: Zabach, Elke (elke.zabachsap.com)
Date: Thu Sep 04 2003 - 02:17:19 CDT


 jain cj wrote:

> Hi,
>
> Here I am facing one problem. I want to find the date
> difference like this
>
> SELECT
> uf.*
> FROM
> SI_UnavailableFund_v uf, SI_BusinessDate bd
> WHERE
> (bd.BusinessDate - (NVL( uf.ExpiryDate, TO_DATE( '01-01-2300',
> 'MM-DD-YYYY' ))) < 0)
>
> but it is not allowing NVL here. (Oracle mode)
>
> Internal mode is supporting 'DATEDIFF' but it will give +ve
> value always no
> <0 .
>
> so how can find the date difference (+ve and -ve not absolute value).

What do you think about (Oracle mode)
WHERE
     MONTHS_BETWEEN (bd.BusinessDate -
                                       NVL( uf.ExpiryDate, TO_DATE( '01-01-2300', 'MM-DD-YYYY' ))) < 0

Elke
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
sapdb.generallistserv.sap.com
http://listserv.sap.com/mailman/listinfo/sapdb.general