Hi. I'm fairly new to developing reports in COGNOS Report Studio and have a question.
What is the best expression to pull a report for the previous work week (Monday thru Friday)?
For example, today is Tuesday and if I run the sales report today, I want it to show all transactions from last Monday thru Friday. The same applies to whatever day I decide to pull the report.
E.g. Filter:
[Date] between
_add_days ( current_date
, (-1) * ( _day_of_week ( current_date,1)-1 )
)
and
_add_days ( current_date
, (-1) * ( _day_of_week ( current_date,1)-1 ) +4
)
Thanks.
I came across another expression that seemed to work for me:
[Date] between
_add_days(current_date, (-1 * _day_of_week(current_date,2)) - 7)
and
_add_days(current_date, (-1 * _day_of_week(current_date,2)) - 3)