If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Conversion

Started by gshilpa24, 28 Sep 2010 01:22:01 AM

Previous topic - Next topic

gshilpa24

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.

blom0344

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

gshilpa24

Thank you very much for the help.