COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: psandhya408 on 07 Jul 2013 12:13:08 AM

Title: Issue with Data conversion
Post by: psandhya408 on 07 Jul 2013 12:13:08 AM
 I have an data item in my table which is of type varchar but it is a date value

Birthdate=10212010

and also I have some zero values in the table for this dataitem. I am trying to change the format of the birthdate from char (10212010) to date( Oct 21,2010) as per the requirements

Is there any way Can i change the zero value data item to null value.

Because when I am trying to change the data item(00000000) to date  It gives me an error saying that it is not a valid
Title: Re: Issue with Data conversion
Post by: HalfBloodPrince on 08 Jul 2013 12:23:48 AM
try this query calculation
if ( [date]=0 ) then
(null)
else
([Date])

then try function  to remove null values or show text u want for null values  coalesce ([Date],'NA')
Title: Re: Issue with Data conversion
Post by: psandhya408 on 08 Jul 2013 05:29:50 PM
Thanks..It worked