COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: gshilpa24 on 28 Sep 2010 01:22:01 AM

Title: Conversion
Post by: gshilpa24 on 28 Sep 2010 01:22:01 AM
Hi,

I have a column called "Current_Month" which has the data
2010-06, 2010-07,2010-08 etc.
This doesn't give the date but has only year and month. The source is SQL Server 2005.

Can this current_month data be converted in this way?

June 2010
July 2010 etc.

Please let me know the syntax if its possible.
Title: Re: Conversion
Post by: blom0344 on 28 Sep 2010 02:27:53 AM
Sure:



CASE WHEN
SUBSTRING([CURRENT_MONTH],6,2) = '01'
THEN
'January '||SUBSTRING([CURRENT_MONTH],1,4)
WHEN
SUBSTRING([CURRENT_MONTH],6,2) = '02'
THEN
'Februari '||SUBSTRING([CURRENT_MONTH],1,4)
...
...
WHEN
SUBSTRING([CURRENT_MONTH],6,2) = '12'
THEN
'December '||SUBSTRING([CURRENT_MONTH],1,4)
ELSE
NULL
END
Title: Re: Conversion
Post by: gshilpa24 on 28 Sep 2010 04:35:06 AM
Thank you very much for the help.