I am working with Concurs IBM Cognos integrated solution. The data i am working with is travel expense report data. My goal for this report is to have a prompt page that allows the user to select the timeframe from which the report should pull the data. Since this report may also be scheduled to run on a regular basis, it should not only include a daterange prompt (or in this case two date prompts), but also options for relative timeframes like "Last year", "Last 6 months" and "Year to date".
So far i have set up a prompt page using two dateprompts ("TravelDateIntervallStart" and "TravelDateIntervallEnd") and two value prompts. Only one of these value prompts is relevant for the timeframe options though. The idea is to have the dateprompts in place for the user to run ad hoc reports for a specific timeframe. The value prompt ("RelativeTimePrompt") should then provide the options to use a relative timeframe depending on when the report is scheduled to run, in addition to the "SelectTimeFrame" option where the date prompts are used. I have set up the options accordingly within the value prompt and built a filter as follows:
CASE ?RelativeTimePrompt?
WHEN 'SelectTimeframe' THEN
([Arrival Date/Time] between ?TravelDateIntervallStart? and ?TravelDateIntervallEnd?
AND
[Departure Date/Time] between ?TravelDateIntervallStart? and ?TravelDateIntervallEnd?)
WHEN 'Last12m' THEN ([Arrival Date/Time] >= _add_years (current_date, -1) AND [Departure Date/Time] >= _add_years (current_date, -1))
WHEN 'Last6m' THEN ([Arrival Date/Time] >= _add_months (current_date, -6) AND [Departure Date/Time] >= _add_months (current_date, -6))
WHEN 'Year2Date' THEN (_year([Arrival Date/Time]) = _year (current_date) AND _year([Departure Date/Time]) = _year (current_date))
END
When "Year to date" ("Year2Date") is selected in the value prompt, then it throws an error:
"RQP-DEF-0177 An error occurred while performing operation 'sqlPrepareWithOptions' status='-126'. CAF-WRN-2082 An error has occurred. Please contact your administrator. The complete error has been logged by CAF with SecureErrorID:"[some date and number]
Ofc i googled the error, but wasnt able to find anything applicable in my case. Is there anything obvious that might be causing an error with the "Year to date" filter?