COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: clingst on 01 Aug 2015 04:43:04 AM

Title: How can I convert integer to date with ddmmyy in iSeries DB2 in cognos framework
Post by: clingst on 01 Aug 2015 04:43:04 AM
i have no luck on research and got the solution on this... attempting to convert/cast given integer (eg: 301193) to date with format 1993-11-30. I need the date data type to build my cube.. and i should use 'Database only' or 'limited local' for query processing mode...
Title: Re: How can I convert integer to date with ddmmyy in iSeries DB2 in cognos framework
Post by: bdbits on 03 Aug 2015 09:43:00 AM
This is untested, but the expression would be something like this. Check the user guide, function tab in the expression editor for more information.

cast(substring(cast(myinteger,varchar(6)),3,2)+'-'+substring(cast(myinteger,varchar(6)),1,2)+'-'+substring(cast(myinteger,varchar(6)),5,2),date)