COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: S_N_Solution on 05 Jun 2008 02:49:28 AM

Title: How to Change the Varchar2 Data type to date for a data item.
Post by: S_N_Solution on 05 Jun 2008 02:49:28 AM
I have two columns in report having varchar2 data type(Date enter as Varchar2).Now i want to subtract those columns and want to show the duration between those time.But because data is entered as Varchar2,i am not able to calculate this value.Please suggest me how should i get the difference between those columns.
Title: Re: How to Change the Varchar2 Data type to date for a data item.
Post by: blom0344 on 05 Jun 2008 04:17:35 AM
With the proper format you should be able to use a simple cast to convert to date:


cast([dateasvarchar],date)

Title: Re: How to Change the Varchar2 Data type to date for a data item.
Post by: jahnavi on 11 Jun 2008 06:44:20 AM
use cast function it will convert the datatypes in the report.Syantax is

cast(Expression,datatype_conversion)
Title: Re: How to Change the Varchar2 Data type to date for a data item.
Post by: blom0344 on 11 Jun 2008 02:48:44 PM
Quote from: jahnavi on 11 Jun 2008 06:44:20 AM
use cast function it will convert the datatypes in the report

Please take note of earlier replies. You are just echoing my response.
Add or correct it instead of repeating it's contents..