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

How to convert YYYYMM to YYYY/MM

Started by kane, 15 Dec 2010 07:51:19 AM

Previous topic - Next topic

kane

Hi All,

Any one can help me how to convert YYYYMM to YYYY/MM ....please :(

Lynn

The answer can vary depending on the data type and DBMS are you using.

If it is a number you could try:

substring(cast([YourField],CHAR(6)),1,4) || '/' || substring(cast([YourField],CHAR(6)),5,2)

Personally, I think the ideal situation is if you can get this done on the database side as part of the ETL process (if that applies in your situation) or in a view definition.

macpao64

hi,

you can create a query calculatuon or a layout calculation,
and write this string:   to_char([name_of_field], 'yyyy/mm')
into Expression Definition


bye

kane

Hi Macpao64,

hi, my Column name is Monthid = 201004...i need to convert to 2010/04 ...
I tried by using sting iam getting error. Iam using oracle database.


RQP-DEF-0177 An error occurred while performing operation 'sqlOpenResult' status='-28'.
UDA-SQL-0114 The cursor supplied to the operation "sqlOpenResult" is inactive.
UDA-SQL-0107 A general exception has occurred during the operation "open result".
ORA-01481: invalid number format model


MFGF

Meep!

sir_jeroen

what about: to_char(to_date([field];'yyyymm');'yyyy/mm')