Search code examples
cognoscognos-11

COGNOS 11 Date Filter for 2019-01-01 to current date


I'm in need of running a COGNOS report Daily in which I need data for 2019-01-01 to the current date,-1. I have been using a Filter for the [Date] between YYYY-MM-DD and YYYY-MM-DD with no issue, but unable to find a way to pull data with a starting date to current date, -1.

Does anyone have experience with this?


Solution

  • Try this filter:

    [Date] BETWEEN 2019-01-01 AND _add_days(current_date,-1)
    

    Since 2019-01-01 is the first day of the year, you could even generalize this further:

    extract(year,[Date]) = extract(year,current_date) AND [Date] <= _add_days(current_date,-1)
    

    This will return all data from the beginning of the current year up to and including the day previous to when it is run whether run this year or any year.