"where a12.year_id = " & Parameters!years.Value &
" and a12.month_of_year in ( " & Parameters!months.Value &" ) " &
but when I run the report raise an error
someone kwon if it's possible to use the IN statement within a dynamic query?
I've setting The parameter month as multivalue
thanksI don′t know where you enter that query, but if you use the query in the command text of the report designer you can simply use the WHERE SomeColumn IN(@.ParameterName)
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de|||I enter thsi query in the Edit Expression because I need to use the IIF function!
Within the Edit Expression the @.someVariable is an identifier Unknow, you must use Parametres!someVariable.value
If I use the variable without multivalue option , it works right
"where table.fied =" & Parametres!someVariable.value
If I use the variable with multivalue option , it don't work right
"where table.fied IN ( " & Parametres!someVariable.value & ")"
tanks|||You can use dynamic queries as expressions and use a "IN" statement. The problem, or "bug", is that with dynamic queries the dataset may not get refreshed when something is changed. You can use the field value (Parameters!Some_param.Value) or the query syntax (@.Some_Param).
The way I've worked around this is to actually drop in a straight query with my parameters, refresh the dataset, then run the report for good measure. Once I know it runs I then put in my dynamic query expression and all seems to work.
Try this... and I hope it helps.|||thanks
Now it works
abc_abc
No comments:
Post a Comment