NebDaMin
NebDaMin

Reputation: 658

IBM Cognos Parameter Syntax for last month

I have a report in Cognos, in this report I have a date filter that will be passed by the user and I want the result set to include dates from the last 30 days. Essentially (?date? - <30days>) I am unfamiliar with the syntax to accomplish this because date is not a primitive type.

[Time stamp] <= ?date?  
and
[Time stamp] >= (?date? - <30days>)

I would appreciate any advice you guys may have.

Upvotes: 1

Views: 809

Answers (2)

Ivan M
Ivan M

Reputation: 21

In case you in fact need a month, not just 30 days, you might want to use _add_months(?date?, -1)

Upvotes: 2

Darek
Darek

Reputation: 4797

Use [Time stamp] >= _add_days( current_date(), -30)

Upvotes: 3

Related Questions