Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services IIF语句中的SSRS多脉冲条件_Reporting Services_Ssrs 2008 R2 - Fatal编程技术网

Reporting services IIF语句中的SSRS多脉冲条件

Reporting services IIF语句中的SSRS多脉冲条件,reporting-services,ssrs-2008-r2,Reporting Services,Ssrs 2008 R2,我有一份IIF声明,看起来像 IIF(Fields!Title.Value=“Option1”,Fields!OptionValue\u Current.Value/(DateDiff(“m”,Fields!Effective\u Date.Value,Fields!EndDT.Value)+1), IIF(Fields!Title.Value=“Option2”,Fields!OptionValue_Current.Value/(DateDiff(“m”,Fields!st_Date.Valu

我有一份IIF声明,看起来像

IIF(Fields!Title.Value=“Option1”,Fields!OptionValue\u Current.Value/(DateDiff(“m”,Fields!Effective\u Date.Value,Fields!EndDT.Value)+1),
IIF(Fields!Title.Value=“Option2”,Fields!OptionValue_Current.Value/(DateDiff(“m”,Fields!st_Date.Value,Fields!EndDT.Value)+1),
IIF(Fields!Title.Value=“Option3”,Fields!OptionValue_Current.Value/(DateDiff(“m”,Fields!Effective_Date.Value,Fields!EndDT.Value)+1)

有没有办法把它减下来,这样我就可以吃点像这样的东西

IIF(Fields!Title.Valuie=“Option1”Option2“Option3”,Fields!fbrt\u OptionValue\u Current.Value/(DateDiff(“m”,Fields!Effective\u Date.Value,Fields!cce\u TermEndDT.Value)+1)

谢谢你的帮助

这个怎么样


尽管SWITCH并没有大大提高字符数,但它在逻辑上是最清晰的。为了让其他可能有此问题的用户更清楚,您应该添加一些关于您正在做什么的描述。谢谢!:DThanks@MatthewR的评论。这是一个非常具体的情况,是关于如何重写asker的代码。但我会保留它记住。
Switch(
Fields!Title.Valuie = "Option1",  
Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value)+1,

Fields!Title.Valuie = "Option2",
Fields!OptionValue_Current.Value / (DateDiff("m", Fields!st_Date.Value, Fields!EndDT.Value)+1,

Fields!Title.Valuie = "Option3",
Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value)+1
)
= IIF(Fields!Title.Value = "Option2", 
(Fields!OptionValue_Current.Value / (DateDiff("m", Fields!st_Date.Value, Fields!EndDT.Value)+1),
(Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value)+1)
)
=Fields!OptionValue_Current.Value / 
         (DateDiff("m", 
                   IIF(Fields!Title.Value = "Option2",Fields!st_Date.Value, Fields!Effective_Date.Value),
                   Fields!EndDT.Value
                  )+1
         )