java ssrs匿名_SSRS program flow for 'Yes' 'No' 'Other'
发布日期:2021-06-24 12:43:30 浏览次数:2 分类:技术文章

本文共 1520 字,大约阅读时间需要 5 分钟。

I'm creating an SSRS report and have three Date fields.

StartDate TargetDate CompleteDate

In my report I want to create a calculated field with a few conditions to determine if the Target Dates have been met.

If CompleteDate <= TargetDate then "Yes", "No"

If CompleteDate is NULL but TargetDate has not exceeded current date then "Pending","No" (ie, startdate was 01/01/2019 and targetdate is 20/03/2019)

Edit 1*

IIF(Fields!CompleteDate.Value <= Fields!TargetDate.Value, "Yes", IIF(Fields!CompleteDate.Value Is Nothing AND Fields!TargetDate.Value < Now(), "Pending", "No")

This returns "No" or "Pending" even if the TargetDate has been met.

Edit 2*

IIF((Format(Fields!CompleteDate.Value,"dd-MM-yyyy") <= (Format(Fields!TargetDate.Value,"dd-MM-yyyy"), "Yes", IIF(Fields!CompleteDate.Value Is Nothing AND Fields!TargetDate.Value < Now(), "Pending,"No")

Error in regards to "Overload resolution failed because no accessible 'IIF' accepts this number of arguments." Is there a bracket misplacement?

Edit 3* @Sentinel - The Switch expression worked perfect

=Switch( NOT isNothing(Fields!CompleteDate.Value) AND Fields!CompleteDate.Value <= Fields!TargetDate.Value, "Completed On-Time" , NOT isNothing(Fields!CompleteDate.Value) AND Fields!CompleteDate.Value > Fields!TargetDate.Value, "Completed Late" , isNothing(Fields!StartDate.Value), "Not Started" , Fields!TargetDate.Value > Now(), "In Progress" , Fields!TargetDate.Value <= Now(), "Running Late" , TRUE, "Other")

Thanks @Sentinel, @Steve-o169 I very much appreciate it

转载地址:https://blog.csdn.net/weixin_32820131/article/details/114558480 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:java xml原理_java – XML命名空间的工作原理
下一篇:java隔行读取存入数组_JAVA将任意txt文档中的内容分行存入数组

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2024年04月14日 02时31分12秒