如何从SSRS参数下拉列表中删除多个值

时间:2014-09-04 12:38:01

标签: reporting-services ssrs-2008 report bids

我有一个报告,我想在下拉列表中添加参数。该数据库有超过13,000条记录,我想要添加的参数是记录中的建筑物名称。大约有6个不同的建筑名称。当我通过从查询中获取值并将建筑物名称作为值添加来添加参数时,下拉列表会重复所有13,000条记录的6个建筑物名称,而不仅仅是6个建筑物名称。

有没有办法可以过滤它来显示6个建筑物名称,然后显示与该建筑物名称相关的记录?

SELECT  new_studentid, new_studentinformationid, new_firstname, new_lastname, new_building, new_busnumber, new_grade, new_primaryhomeroom,documentbody FROM  StudentInformation WHERE(new_building = @new_building) AND (new_primaryhomeroom = @new_primaryhomeroom)

1 个答案:

答案 0 :(得分:1)

您只需要为参数下拉列表进行查询。应该是这样的:

SELECT  DISTINCT new_building
FROM  StudentInformation 

然后,对于HomeRoom参数,请使用以下查询:

SELECT  DISTINCT new_primaryhomeroom
FROM  StudentInformation 
WHERE(new_building= @new_building)
相关问题