COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: locus on 04 Dec 2012 11:49:02 PM

Title: Report Studio Filter for a Defined Daily Period
Post by: locus on 04 Dec 2012 11:49:02 PM
Morning Folks,

I am currently running a series of reports each morning that I would like to schedule.

The existing prompt page parameters are as follows

[start.dtim]>=?Parameter1?
[end.dtim]<=?Parameter2?


The prompt values are always as follows: 

?Parameter1?>=7am (for previous day)
?Parameter2?<=7am (for current day)


How do I write this in so when it runs at 8am each morning, I always get values between 7am (yesterday) and 7am (today)?

I currently use the following filter on a slightly different report but am having trouble modifying it
............between (trunc(_add_days({sysdate}, -1),'dd')) and (trunc({sysdate}))

Appreciate any help.

Cheers,
Locus
Title: Re: Report Studio Filter for a Defined Daily Period
Post by: chipslam on 05 Dec 2012 12:27:58 AM
which db you are using ?
Title: Re: Report Studio Filter for a Defined Daily Period
Post by: locus on 05 Dec 2012 01:08:31 AM
Informix
Title: Re: Report Studio Filter for a Defined Daily Period
Post by: RubenvdLinden on 05 Dec 2012 05:01:04 AM
This might help:

Yesterday: cast(_add_days(current_date; -1); timestamp) + 7 hour
Today: cast(current_date; timestamp) + 7 hour
Title: Re: Report Studio Filter for a Defined Daily Period
Post by: locus on 05 Dec 2012 06:47:32 AM

That's spot on. 100%

Thanks Ruben!
Title: Re: Report Studio Filter for a Defined Daily Period
Post by: RubenvdLinden on 06 Dec 2012 05:01:49 AM
You're welcome!