如何使多值参数独立于2个依赖的级联多值参数?

问题描述 投票:0回答:1

我有3个下拉参数D,E,F。在3个参数的每一个中只能选择1个值。 2相互依赖,1与2独立。但是所有3仍然取决于参数A OR B OR C。总共需要6个参数。数据集1:

select name,birthdate,id,sex 
               from patient
           where name = @D
           and (number = @A OR(@No IS NULL))
           and (dateofbirth =@B OR (@DOB IS NULL))
           and (id =@C OR (@ID IS NULL))

Dataset_Dropdownparameter_D:

select DISTINCT firstname
from patientNAW
where dateofbirth =@B
or id =@C
or number = @A 

Dataset_Dropdownparameter E:

select DISTINCT name
from patientNAW
where number = @A 
or id =@C
or dateofbirth =@B

Dataset_Dropdownparameter F:

select DISTINCT Marriedname
    from patientNAW
    where dateofbirth =@B
    or number = @A 
    or id =@C

Please click on this to see picture Parameter A,B,C

已经为B和C设置了相同的名称。只是输入了它们。

主键是数字。例如,如果我有双胞胎,我不想显示一个病人,我可以只插入生日和姓名来运行报告。

并且参数F(结婚名称)与参数名称无关。例如,我应该能够键入生日,然后我会得到一个带有该生日的名字的下拉列表。

reporting-services
1个回答
0
投票

检查完您的问题但未进行任何测试之后,我认为这可能就像将数据集查询编辑为一样简单

select name,birthdate,id,sex 
               from patient
           where name = @D
           and (number = @A OR @A IS NULL)
           and (dateofbirth =@B OR @B IS NULL)
           and (id =@C OR @C IS NULL)

您需要测试参数是否为null,是否忽略它,但是您正在使用其他一些参数(不确定它们来自何处)

© www.soinside.com 2019 - 2024. All rights reserved.