COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: rajurokz on 17 Nov 2017 01:05:59 PM

Title: Date Conversion
Post by: rajurokz on 17 Nov 2017 01:05:59 PM
Hi all,

I have requirement to convert the date format at report level,

Input date format - CYYMMDD
Output date format - MM/DD/YY,
Where C is century code When C = 0 then 19, C = 1 then 20 has to be displayed and the required date format is MM/DD/YY.

Please help me in achieving this requirement.

Thanks,
Rajurokz!
Title: Re: Date Conversion
Post by: New_Guy on 22 Nov 2017 09:15:41 AM
Hi,
Cast the date to varchar and then creata a data item with case when and substring to catch 0 or 1 and then substitute them with 19 or 20. After that cast them back as date. Please let me know if you need clear steps. Let us know what you are getting when you cast the actual date to varchar.
Good luck