DataSet query with Parameters does not work in Rep

2019-05-11 03:30发布

The following picture shows the query and its result with no variables:

enter image description here

The next one shows the same query with a variable and a different result:

enter image description here

This how the parameter was set just before the query execution:

enter image description here

I have also tried setting the parameter without '' but it produces the same result.

Any clue about what's going on? Any help would be greatly appreciated.

NOTE: The DBMS is MySql

2条回答
萌系小妹纸
2楼-- · 2019-05-11 03:53

In Report Builder 3.0 you can user parameters in a dataset query using the following syntax: WHERE sql_column_name = (@Parameter_name_in_ReportBuilder)

Example: SELECT * from [dbName].[dbo].[TableName] WHERE Account=(@Parameter1)

Before you can run the report, you need to configure a paramter named Parameter1 (in this example, change this to the name of your parameter) in Dataset Properties - Parameters. The value field should be set to one of the parameters

查看更多
三岁会撩人
3楼-- · 2019-05-11 04:05

This weird issue is due to the fact that SSRS is connected to MySQL by ODBC connector; therefore, the query parameters should be defined as ? and their names are Parameter1, Parameter2, etc... in order of appearance

Source: http://www.tek-tips.com/viewthread.cfm?qid=1354185

查看更多
登录 后发表回答