Using ToDate Function

Hi,
I have a problem with using todate function.
I have a string which contain year and month.
I need to convert this to Date so that I can get the Month.

For e.g. String contains “2009-10” and I need it as October

Can some one help me in this?

Regards
Niranjan


nvkanade (BOB member since 2009-06-25)

Hm… Append 01 to your string “2009-10” convert it to Date and then use Month() function. Something like this will help you out.

=Month(ToDate([String date]+"-"+"01","yyyy-MM-dd"))

Jansi :india: (BOB member since 2008-05-12)

Hello,
you can try something like this:

select substr('2009-10',0,5)||to_char(to_Date(substr('2009-10',6,2),'MM'),'Month') from dual

If it doesn’t work let me now please

Regards

edit: sorry, I did not see a preevious response

[Moderator Edit: Added code formatting - Jansi]


radiohead :portugal: (BOB member since 2007-04-13)

Do we have TO_CHAR() function in WEBI?


Rakesh_K :india: (BOB member since 2007-12-11)

:nonod: No to_Date(), dual too. It should be a universe level suggestion.

@radiohead: Please post the db details too when you’re providing universe level solutions. Thanks.


Jansi :india: (BOB member since 2008-05-12)

Hello,

sorry you’re right, this was a basis for a solution at universe level, and that would apply to a Oracle Database.

Best Regards


radiohead :portugal: (BOB member since 2007-04-13)