Forum Stats

  • 3,727,168 Users
  • 2,245,331 Discussions
  • 7,852,618 Comments

Discussions

Year and Month Number format

Hi team,

We have date format column (6/21/2018 7:01:00 AM) we need extract year and month number ( 2018 06) from the date field in obiee RPD level can someone assist.

OBI Version using: Oracle Business Intelligence 12.2.1.4.0

Regards,

Answers

  • Gianni Ceresa
    Gianni Ceresa Managing Director | Oracle ACE Director Member Posts: 6,155 Gold Crown

    If you look at the available functions in OBIEE there is a whole set about dates, including extracting components from a date. Just look in the UI and you will see the list of functions available.

  • User_JZKI6
    User_JZKI6 Member Posts: 34 Green Ribbon
    edited April 6

    Thanks for the reply.

    We used below year and month functions but format we are getting is 20186, we are looking for 201806 can you suggest on this.

    CAST(YEAR("table.Date") AS CHAR)||CAST(MONTH("table.Date") AS CHAR)

    is there any other function which we can achieve in 201806 format

  • Gianni Ceresa
    Gianni Ceresa Managing Director | Oracle ACE Director Member Posts: 6,155 Gold Crown

    It's simple logic, if you don't store the right format in your database, you just have to build it by yourself.

    So with some basic logic you could multiply YEAR(date) by 100 and you sum it with MONTH(date) and you can finally turn the resulting number into a char if that's the format you are after.

  • SriniVEERAVALLI
    SriniVEERAVALLI Member Posts: 8,539 Gold Crown

    Try using column data formats or else use string functions as Mr. Gianni suggested.

Sign In or Register to comment.