COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Vick on 06 May 2008 08:19:22 AM

Title: Display yesterday's date
Post by: Vick on 06 May 2008 08:19:22 AM
Can anyone tell me how can I display yesterday's date in my report heading.


Thanks,
Vick.
Title: Re: Display yesterday's date
Post by: cbortkun on 06 May 2008 11:32:22 AM
Create a data item containing the following function:
   current_date - 1 day

Insert the data item in your report heading.

Chuck
Title: Re: Display yesterday's date
Post by: Vick on 06 May 2008 12:52:46 PM
Thank You. I will check it out.

Vick
Title: Re: Display yesterday's date
Post by: Anand on 07 May 2008 02:17:55 AM
use query caluculation add_days(date,-1)
Title: Re: Display yesterday's date
Post by: blom0344 on 07 May 2008 05:18:21 AM
You'll probably need to associate the the query that provides the date calculation with the page of the page header. Otherwise the page header will only accept report expressions..
Title: Re: Display yesterday's date
Post by: Vick on 08 May 2008 05:20:18 PM
Chuck,
          When I create data item with current_date -1 it gives me following error when I run the report.


An error on or around the position '0'. The variable named '[Query1].[Data Item1]' is invalid.

Thanks,
Vick.
Title: Re: Display yesterday's date
Post by: rockytopmark on 08 May 2008 08:53:01 PM
Vick, read Blom0344's post.  Your invalid Variable error is solved if you do what Blom0344 suggests. 

If you are on Cognos 8.3 you can use a Singleton instead
Title: Re: Display yesterday's date
Post by: Gopinath on 09 May 2008 03:53:50 AM
Associate the Query to th report Page

Create a query calculation _add_days(current_date, -1)

Display it in the report header