COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sam627 on 24 Oct 2019 07:42:29 AM

Title: Formula for showing future continuous days of data
Post by: sam627 on 24 Oct 2019 07:42:29 AM
Hello, I am trying to schedule an automatic report that runs daily and shows the next 10 days of scheduled data. I work in a healthcare facility and want to see the future schedule.

I am currently using this formula:
cast([Patient Procedure Schedule Date] as date) = _add_days(cast(getdate() as date), 10)

this is only giving me the data for 10 days out so today is 10/24 it gives me data for ONLY 11/3. Is there a way to get continuous days of data?
So I need data for 10/24, 10/25, 10/26, 10/27, 10/28...and so on
Title: Re: Formula for showing future continuous days of data
Post by: BigChris on 24 Oct 2019 08:13:59 AM
cast([Patient Procedure Schedule Date] as date) between current_date and _add_days(current_date,10)
Title: Re: Formula for showing future continuous days of data
Post by: sam627 on 24 Oct 2019 08:23:08 AM
PERFECT! Thank you so much!  ;D

Also, how did you learn these formulas? Is it just from experience or is there a training/skill to learn that would be beneficial?
Title: Re: Formula for showing future continuous days of data
Post by: Francis aka khayman on 24 Oct 2019 01:15:36 PM
you'll need a whole lot of hours looking around the formula tab