1 Reply Latest reply: Apr 4, 2012 6:05 AM by Penky RSS

    How to calculate a Date

    SergioSoto
      Hi all,

      I'm taking a rtf template in BI Publisher and I have a problem with calculate a Date from the data received from a "xml". the format is the following :

      <CreatedDate>08/24/2011 17:40:23</CreatedDate>

      I need add a number of day according to another param and calculate the date exactly.

      any suggestion for this ?

      I found the following function:

      <?format-date:(xdoxslt:ora_format_date_offset(xdoxslt:sysdate('YYYY-MM-DD'),2,'+'));'DD-MM-YYYY'?>

      but I don't know how to use the data from the xml.

      thanks.
        • 1. Re: How to calculate a Date
          Penky
          Sergio

          this should do the job:

          <?format-date:xdoxslt:ora_format_date_offset(psfn:getCanonicalDate(CreatedDate),2,'+');'DD-MM-YYYY'?>

          assuming your data comes from Siebel. Additionally, you should put in the known psfn tag into your template to be able to use the getCanonicalDate function.
          ( <?namespace:psfn=http://www.oracle.com/XSL/Transform/java/com.siebel.xmlpublisher.reports.XSLFunctions?> )