COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ajrev on 09 Feb 2009 01:32:06 PM

Title: Date calculation
Post by: ajrev on 09 Feb 2009 01:32:06 PM
I am wondering if anyone can send me an example of a date calcuation.
I am trying to calculate from 21 days from an enrollment date. How would I create this in an expression?
Title: Re: Date calculation
Post by: kaevne on 09 Feb 2009 02:23:50 PM
I believe the function you're looking for is _add_days(...)  The exact parameters are in the report studio user guide I believe.
Title: Re: Date calculation
Post by: NaviGator on 09 Feb 2009 03:03:44 PM

As Kaevne mentioned, you can use the _add_days( date1, int) but you should use - int for subtraction.

So, if you want to subtract 21 days from any given date, the calculation should be something like

_add_days( enrollment_date, -21)


Hope this will solve your problem.