我在SSRS中有这个SQL:
Select * From
(
Select TermCode, SubjectCode, Course, QuestionNbr, Answer, Question_Format, Question_Text, Tally
From View_Responses_CourseLvl
Where Form_Category = 'SIRS' and TermCode = @Term and SubjectCode = 'ANR' and cast(left(Course, 3) as int) = 250 and Question_Format = 'Radio-Option') t
Pivot (sum(Tally) for Answer in (@AnswerParms)) as pvt
问题是,当我尝试运行它时,我收到此错误:
Incorrect syntax near @AnswerParms
我真的看不出问题出在哪里或者如何解决问题。我没看到什么?
答案 0 :(得分:0)
SSRS报表设计器无法使用数据集返回的动态集列。
我将删除SQL Pivot和外部SELECT,并使用SSRS列组功能按“答案”分组。