如何从多个选择服务器报告中获取数据

时间:2018-01-23 04:12:23

标签: mysql sql-server reporting-services

enter image description here

enter image description here

第二次下拉是多选。当我选择多个民意调查获得错误时,我只选择一次民意调查时工作正常"'附近的语法不正确,' "

我的数据集查询是

SELECT tblPS_Question.Question
    ,tblPS_PollSurveyMaster.PollSurveyID
    ,tblPS_PollSurveyMaster.PollSurveyName
FROM tblPS_Question
INNER JOIN tblPS_PollSurveyMaster ON tblPS_Question.PollSurveyID = tblPS_PollSurveyMaster.PollSurveyID
WHERE (tblPS_PollSurveyMaster.IsActive = 1)
    AND (tblPS_PollSurveyMaster.PollSurveyName = @PollSurveyName)

我认为@PollSurveyName只采用一个投票名称如何传递多个名称,以便根据传递的名称填充问题下拉列表。

1 个答案:

答案 0 :(得分:0)

假设@PollSurveyName是第一个参数的名称,那么只需将最后一行更改为

AND (tblPS_PollSurveyMaster.PollSurveyName IN(@PollSurveyName))