SYMPTOM:
When executing a report with an attribute qualification filter containing a "Between" operator and embedded with attribute element prompts, the below error appears:
Error: SQL Generation Complete
QueryEngine encountered error: Execute Query failed.
Error type: Odbc error. Odbc operation attempted: SQLExecDirect. Incorrect syntax near the keyword 'in'.
STEPS TO REPRODUCE:
Follow the steps below to reproduce the issue with Strategy Tutorial Project:


Error: SQL Generation Complete
QueryEngine encountered error: Execute Query failed.
Error type: Odbc error. Odbc operation attempted: SQLExecDirect. Incorrect syntax near the keyword 'in'.
CAUSE:
This is expected behavior.
Below is the report SQL for the above report. When attribute element list prompt is used in the report, SQL Engine will generate an IN clause, however it conflicts with the Between operator in report filter which caused the report failed to run.
select a11.YEAR_ID YEAR_ID from LU_YEAR a11 where a11.YEAR_ID between a11.YEAR_ID in (2007) and a11.YEAR_ID in (2010)
ACTION:
Starting from Strategy 9.0.0, element list prompts can be used in database passthrough functions, e.g. ApplyComparison.
Follow the below steps to create two report filters with ApplyComparison query to eliminate the error:

ApplyComparison ("#0 in (select year_id from lu_year where year_id >= #E1)", Year@ID, ?)
ApplyComparison ("#0 in (select year_id from lu_year where year_id >= #E1)", Year@ID, ?)
select a11.YEAR_ID YEAR_ID from LU_YEAR a11 where (a11.YEAR_ID in (select year_id from lu_year where year_id >= 2010)and a11.YEAR_ID in (select year_id from lu_year where year_id >= 2007))
For details regarding how to use element list prompts in database passthrough functions, refer tot the below technical note: