COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: suhas_bhat on 23 Jan 2011 10:23:08 PM

Title: How to filter data from "from year,month" to "to year, month"?
Post by: suhas_bhat on 23 Jan 2011 10:23:08 PM
Hi all,
  I am using a relational package with Oracle database.
I have 4 value prompts viz. "from year","from month","to year" and "to month" and i need to filter data for say Eg:Oct,2009 to Jan 2011"

I tried doing it this way, concatenating ?f_month?||'01'||?f_year? and then typecasting to DATE so that i could filter using my [calendar date] field.
Unfortunately this is not working, am getting errors like 'sqlPrepareWithOptions' status='-126'. and 'sqlScrollBulkFetch' status = '-232'. These errors are coming only for this particular report even when i test usin hardcoded values like Eg: to_date('01-10-2010','DD-MM-YYYY)  >:(

Is there any alternate way to code this?? My use value for year and month are [year] and [month number]

Please help..
Title: Re: How to filter data from "from year,month" to "to year, month"?
Post by: PRIT AMRIT on 24 Jan 2011 01:26:25 AM
Can we try it in other way around?

It's weird but just for testing....

Extract the Year, Month, Day from your [Calenderdate] item.
Create another data 'CalDate' item like, to_number(to_char([YEAR])+to_char([Month])+to_char([Day]))

Filter CalDate=?f_year?+?f_month?+'01'
Title: Re: How to filter data from "from year,month" to "to year, month"?
Post by: suhas_bhat on 25 Jan 2011 04:00:53 AM
Thank you.. this should work out..  :)