在SSRS报告中重复唯一ID的行值

时间:2016-03-14 16:38:26

标签: reporting-services count group-by ssrs-2008 distinct

请查看以下报告(突出显示的值因某种原因重复)

Repeating Rows

Report Design

Query:

SELECT DISTINCT EXSS_Year, STEN_Student_ID, EXSS_Student_ID, 
STUD_Forename_1, STUD_Surname, EXSS_Act_Grade, 
COUNT(Grade) AS Count_Grade, COUNT(CourseType)AS CountType, 
EXSS_Issued_Date, EXSS_Cand_No, EXSS_Awarding_Body, Awarding_body, 
EXSS_Provision_Code, PRPH_ML2, PRPH_ML1, Course, PRPH_Title, 
Section, EXSS_Provision_Instance, EXSS_Subject_Code, EXSJ_Description, CourseType, Grade
FROM FS_Exams_English
GROUP BY EXSS_Year, STEN_Student_ID, EXSS_Student_ID, 
STUD_Forename_1, STUD_Surname, EXSS_Act_Grade, 
EXSS_Issued_Date, EXSS_Cand_No, EXSS_Awarding_Body, 
Awarding_body, EXSS_Provision_Code, PRPH_ML2, 
PRPH_ML1, Course, PRPH_Title, Section, 
EXSS_Provision_Instance, EXSS_Subject_Code, 
EXSJ_Description, CourseType, Grade
ORDER BY STEN_Student_ID

Keelan Shelly的样本数据:

Forename Surname Count_Grade CountType  Section Course  PRPH_Title                        EXSJ_Description                        CourseType    Grade
Keelan  Shelly   0           0        14-16    27448/A01 English E3 FS (14-16) (Pearson)    E3 ENGLISH FUNCTIONAL SKILLS WRITING NULL          NULL
Keelan  Shelly   0           1        CSTR     27239/A01  English L1 FS (for CSTR) (CG)     FUNCTIONAL SKILLS ENGLISH           Overall        NULL
Keelan  Shelly   0           1        14-16    27448/A01 English E3 FS (14-16) (Pearson)    E3 ENGLISH FUNTIONAL SKILLS READING Reading        NULL

让我知道如何避免这种情况。

1 个答案:

答案 0 :(得分:1)

我会将上述查询的结果复制到Excel中。 仔细检查重复的学生的数据。 其中一列中的数据并不完全相同 复制的学生。 实际上很难说哪个列导致重复 看到数据。

希望这有帮助, 标记 http://sqlreports.wordpress.com/