COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Mpotla on 12 Jan 2011 04:53:17 PM

Title: Date Conversion
Post by: Mpotla on 12 Jan 2011 04:53:17 PM
Hi Guys,

I have one requirement to find the last day of the fiscal Year-Month selected and I want to use this date in calculations and filters in the report. so  i have created one parameter map with Key in YYYYMM format and Value 28-NOV-2010 which is date.

Now i have created one data item with expression
#sq($[PM_Last_Fiscal_Sunday]{prompt('Param_Rptg_Period','token')})#, Which is returning date in character format.  I tried using cast() and to_date function but its throwing error.

TO_DATE(#sq($[PM_Last_Fiscal_Sunday]{prompt('Param_Rptg_Period','token')})#,'DD-MON-YYYY').

please help in resolving the issues. Thanks for your help in advance.

Regards,
Potla

Title: Re: Date Conversion
Post by: nag.prasady@gmail.com on 13 Jan 2011 01:27:57 AM
Hi ,
use this  to_date(To_char('your character date','ddsp mmsp yyyysp'))
let me know if it works.
Regards,
Nagendra