COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Sune Jorgensen on 03 Aug 2009 02:29:58 AM

Title: Converting DB2 date format to a date
Post by: Sune Jorgensen on 03 Aug 2009 02:29:58 AM
I have a problem, that I have a DB2 date format that should be converted to a readebly date format.

As an example of a DB2 date format is 108107 which should be the 04/16/2008.

Does any have an idea of how to convert this in Report Studio?
Title: Re: Converting DB2 date format to a date
Post by: Sune Jorgensen on 04 Aug 2009 01:38:33 AM
I have found a algoritm that works:

_add_days(cast_date(trim(cast_char(cast_integer([FIELD]/1000+1900)))||'-01-01'),mod([FIELD]-1,1000))

This change the DB2 date format to a date.