Use condtionnal filter on query to choose a table

0

Hello guys,

I have to MSSQL databases and I want to use query A or query B to select the good one.

I used a parameter in the query :

Select orderDate, totalSales FROM $P{Database}

And I ran into this error : 

the variable of type "@P0"  must be declared

Do you have any clue in order to solve this error ?

iggythedog91's picture
Joined: Sep 20 2019 - 2:08am
Last seen: 1 month 14 hours ago

1 Answer:

1

Hello Iggy,

Your query should work if you use $P!{Database}, this syntax is mandatory.

old question : https://community.jaspersoft.com/questions/1115771/how-set-sql-query-dataset-dynamically

arnaudsimon091's picture
Joined: Nov 26 2018 - 12:25pm
Last seen: 1 week 2 days ago
Feedback