Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Parameter Date Formatting

Received Response
44
Views
5
Comments

Summary

Parameter Date Formatting

Content

In XML Publisher template, how can I format the date parameter to DD-Mon-YYYY format?

<?param@begin: p_start_date?>Start Date -  <?xdofx:substr($p_start_date,1,4) || '-' || substr($p_start_date, 6,2) || '-' || substr($p_start_date, 9,2)?>

With the above format, my output is 2017-09-18, expected output is  18-May-2017

I have even tried with <? xdofx:p_start_date('DD-Mon-YYYY’)?> and <?xdofx:to_char($p_start_date,'DD-MON-YYY')?> but the output is  2017-09-18

Answers

  • Brajesh Shukla-95078
    Brajesh Shukla-95078 Rank 7 - Analytics Coach

    If p_start_date is in canonical date format then you can use to_date in rtf

    example if p_start_date is '2017-05-31T11:37:01.262+00:00' then you can use <?xdofx:to_date(p_start_date,'dd-MMM-yyyy')?>

  • Brajesh Shukla-95078
    Brajesh Shukla-95078 Rank 7 - Analytics Coach

    No I mean was value appearing for p_start_date in xml....can you paste sample value for p_start_date

  • Brajesh Shukla-95078
    Brajesh Shukla-95078 Rank 7 - Analytics Coach

    What is the date format of p_start_date in XML file?

  • Venkat Thota - BIP
    Venkat Thota - BIP Rank 7 - Analytics Coach

    <?xdofx:to_date(SYSDATE,'dd-mon-yyyy')?>   ----if date is in canonical format.

    Also please mention how the p_start_date is appearing in xml file.i.e formart of p_start_date

  • Ja Cobelias
    Ja Cobelias Rank 2 - Community Beginner

    Hello,

    I have defined p_start_date as below, I have not formatted it.

    <parameter name="p_start_date" dataType = "date"></parameter>

    Do I need to format?