Author Topic: Display Date Range in Header  (Read 250 times)

Offline src144

  • Associate
  • **
  • Join Date: Apr 2021
  • Posts: 1
  • Forum Citizenship: +0/-0
Display Date Range in Header
« on: 23 Apr 2021 02:04:29 pm »
First, let me apologize in advance if the topic is posted on the wrong thread. I am using IBM Cognos Report Studio Version 10.2.2. I have a report that is pulling data from the last 7 days. I would like to add a header to reflect the date range. For instance, if I run the report on 4/23, the date range should be displayed on the header to reflect 04/15/2021-04/22/2021. How can this be accomplished?

I have inserted a text item in a block and selected the source type as a report expression. I then have _add_days (AsOfDate (), -7 ) in my expression definition but keep getting errors. Any help is GREATLY appreciated.

Offline BigChris

  • Statesman
  • ******
  • Join Date: Apr 2013
  • Posts: 1,250
  • Forum Citizenship: +91/-0
Re: Display Date Range in Header
« Reply #1 on: 24 Apr 2021 11:58:03 am »
The simplest thing to do is probably to add a calculation in your query for
Code: [Select]
_add_days(current_date,-7)and perhaps a second one for
Code: [Select]
_add_days(current_date,-1)then you can bring them into your header as singletons, perhaps with text fields before and between, so that you get something along the lines of

'Dates between ' [Calculation 1] ' and ' [Calculation 2]