COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Chicken Head on 02 Jan 2007 04:42:10 AM

Title: [Solved] Subtraction of days from date parameter
Post by: Chicken Head on 02 Jan 2007 04:42:10 AM
Is it possible to have a date parameter in a query and subtact a number of days from it in the same filter?

For example

[DS_Presenation].[Calendar].[Date/Month/Year] >= ?Date? -30

I've tried this but it returns an error.

Many Thanks

Mark
Title: Re: [RS] Subtraction of days from date parameter
Post by: sir_jeroen on 02 Jan 2007 12:35:27 PM
What db are you using?
Have you looked in the Functions list under help?
You can use e.g. _add_days

Btw make sure you cast the parameter to a date first...
Title: Re: [RS] Subtraction of days from date parameter
Post by: Chicken Head on 03 Jan 2007 03:48:21 AM
Thanks, the problem was down to not casting the date parameter.