COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: phoenixfire on 28 Oct 2010 12:18:22 PM

Title: Using dates in Report Studio
Post by: phoenixfire on 28 Oct 2010 12:18:22 PM
Hello,
I am trying to run a report based on a two-year date selection. The input date for this selection is actually in the form of a date-timestamp.
This parts works fine. However, I am trying to exclude just one day in this two year period in the prompt.
For eg.
Report runs based on Entry Date from 01Oct08 to 30Sep10. I am trying to exclude 10Sep10 from this date range. Anything that was entered on the 10th needs to be ignored.

Any ideas? Thanks in advance.
Title: Re: Using dates in Report Studio
Post by: cognostechie on 28 Oct 2010 05:50:18 PM
Why are you trying to exclude 10 Sep 10 ? Any logic attached to it? If yes, there are various ways. Ex: Create a calculated column with the logic, assign a value to 10 Sep 10 based on the logic, then use that column in the filter with that value.

If no logic, you could just hard code 10 Sep 10 in the filter to exclude it. Hard coding is not the preferred way though.
Title: Re: Using dates in Report Studio
Post by: rockytopmark on 29 Oct 2010 10:43:28 AM
2 filters in 1 Detail filter object:

Conceptual example:

[theDate] between 01-Oct-08 and 30-Sep-2010
and
[theDate] <> 10-Oct-10

implement however you need, but this should do the trick for you
Title: Re: Using dates in Report Studio
Post by: phoenixfire on 02 Nov 2010 05:26:16 PM
Thanks for both suggestions. But I tried them already. It doesn't work for some reason. The report still includes information from 10sep10.
Title: Re: Using dates in Report Studio
Post by: CognosPaul on 03 Nov 2010 02:20:48 AM
You said your field is a timestamp. Does it include the time too?
10/09/2010 12:00:01 is not the same as 10/09/2010.

Try something like: cast([theDate],date) <> 10-Sep-10
or possibly: to_char([theDate],'yyyymmdd')<>'20100910'