This discussion is archived
3 Replies Latest reply: Jul 18, 2013 11:54 AM by Sasi Nagireddy RSS

repository variable

1012730 Explorer
Currently Being Moderated

In dynamic repository variable initialisation block I have an SQL written. When that SQL is executed in SQL developer its returning a DATE..But when I use that variable in presentation I get a timestamp and have to write CAST(VALUEOF(repository variable name). The requirement is to have DATE value stored in the variable and directly use it in presentation formula..Please let me know why its showing timestamp

  • 1. Re: repository variable
    Robert Angel Pro
    Currently Being Moderated



    Oracle database dates always include a time element.


    i.e. Select to_char(sysdate,'DD-MON-YY hh24:mi:ss') from dual;


    18-JUL-13 16:29:14


    Note the use of to_char was only to make it obvious the level of accuracy.


    In obiee terms this level of accuracy is a timestamp.


    Note you can use Select to_char(trunc(sysdate),'DD-MON-YY hh24:mi:ss') from dual; to get 18-JUL-13 00:00:00 - but the time element is still there...



    Hope this helps,



  • 2. Re: repository variable
    1012730 Explorer
    Currently Being Moderated

    so is there any way to populate the variable with just the date and not the timestamp?

  • 3. Re: repository variable
    Sasi Nagireddy Expert
    Currently Being Moderated

    Try this


    Step-1:- Create a new column in the db on which you want to create a variable.

    Step-2:- Format that column using TO_DATE(DATE_COLUMN,'YYYY-MM-DD')

    Step-3:-Now you can create a variable on this column.


    Mark if helps.




  • Correct Answers - 10 points
  • Helpful Answers - 5 points