Reporting services SSRS参数设置

Reporting services SSRS参数设置,reporting-services,Reporting Services,我是SSRS新手,需要一些设置参数的帮助 select cast(i.invoicedatetime as date) as Date, oi.DepartmentID, departmentname, SubDepartmentName, sum(Quantity*each*UnitPrice-o.DiscountAmount-i.DiscountAmount) as Sales from InvoiceInfo i, orderinfo o, OrderItemInfo

我是SSRS新手,需要一些设置参数的帮助

select cast(i.invoicedatetime as date) as Date, oi.DepartmentID, departmentname, SubDepartmentName, sum(Quantity*each*UnitPrice-o.DiscountAmount-i.DiscountAmount) as Sales
from InvoiceInfo i, 
    orderinfo o, 
    OrderItemInfo oi, 
    DepartmentInfo d, 
    SubDepartmentInfo s
where i.InvoiceID = o.InvoiceID
and o.orderid = oi.OrderID
and oi.DepartmentID = d.DepartmentID
and oi.SubDepartmentID = s.SubDepartmentID
group by DepartmentName, SubDepartmentName, InvoiceDateTime, oi.DepartmentID
order by DepartmentName
我希望有一个名为:Departments的参数,其可用值为以下部门:1,2,3

我的查询如下所示以获取数据:

其中oi.departmentid位于(1,2,3)


我不知道如何设置参数以获得相同的结果。

基本上就是这样做的,转到参数并添加参数,选择类型编号,选择,允许多个。在“可用值”下,选择“指定值”,然后列出每个值。注意:标签是用户将看到的内容,值是SQL将看到的内容。在你的代码中也要改变它

select cast(i.invoicedatetime as date) as Date, oi.DepartmentID, departmentname, SubDepartmentName, sum(Quantity*each*UnitPrice-o.DiscountAmount-i.DiscountAmount) as Sales
from InvoiceInfo i, 
    orderinfo o, 
    OrderItemInfo oi, 
    DepartmentInfo d, 
    SubDepartmentInfo s
where i.InvoiceID = o.InvoiceID
and o.orderid = oi.OrderID
and oi.DepartmentID in (@Departments)
and oi.SubDepartmentID = s.SubDepartmentID
group by DepartmentName, SubDepartmentName, InvoiceDateTime, oi.DepartmentID
order by DepartmentName

请注意,您的参数名没有@,但您的代码必须。此外,SSRS区分大小写,因此请确保匹配

像上面的海报一样,我发现: