DataSet query with Parameters does not work in Report Builder

筅森魡賤 提交于 2020-01-02 08:28:34

问题


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

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

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

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


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/10814477/dataset-query-with-parameters-does-not-work-in-report-builder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!