Friday, May 20, 2011

Replacing NVL Function with Case Statements in OBIEE

A user in Oracle forums today had a question regarding using the following expression in OBIEE:

NVL (A_Date,NVL (B_Date.SYSDATE) - C_Date


This could be possible in two ways, first one using the case statement and second one using IFNULL function.


CASE WHEN A_Date IS NULL THEN (CASE WHEN B_Date IS NULL THEN CURRENT_DATE ELSE B_Date END) END

ifnull(A_Date,timestampdiff(SQL_TSI_DAY, ifnull(B_Date,CURRENT_DATE),C_Date)
 

Until Next Post... :)

No comments:

Post a Comment