3 Replies Latest reply on Jun 25, 2019 6:32 AM by Joel Acha

    Day Difference in OBIEE 11g excluding weekends

    user11048445

      Hi All,

       

                I am trying to find out the the day difference between two dates excluding the sat and sunday but I'm not getting it working. I've tried the following code below, but it not worked well :

       

      DAYOFWEEK("Date_1")-DAYOFWEEK("Date_2")-4+

      (TIMESTAMPDIFF(SQL_TSI_DAY,

      TIMESTAMPADD( SQL_TSI_DAY , 1 - DAYOFWEEK("Date_1"), "Date_2"),

      TIMESTAMPADD( SQL_TSI_DAY , 8 - DAYOFWEEK("Date_2"), "Date_2")))/7*5)

       

              Does anyone knows how to calculate that ?

       

              Thanks in advance.

       

      Regards