cognos formatting

Hi,

I have an expression as below:

to_char(_first_of_month(_add_months(current_date,-6)))   and the output of it is  " 01-JUL-12"

but I need only "JULY". how to get this, please help.
new_perl_userAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Robert SchuttConnect With a Mentor Software EngineerCommented:
Have you tried
to_char(_first_of_month(_add_months(current_date,-6)), 'MONTH')

Open in new window

0
 
SNeupaneConnect With a Mentor Commented:
All you have to do is add extract month in front of it.
For example:
extract(month from to_char(_first_of_month(_add_months(current_date,-6))) )
0
 
SNeupaneCommented:
Or use extract after the to_char like below.
It'll give you month in number:
to_char(extract(month from _first_of_month(_add_months(current_date,-6))))
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.