IsNothing not working on empty value in report bui

2019-07-02 19:33发布

I have an expression in a table that checks if there was a return value.

If the query returns empty or null I want to set the value to 0.

=IIF(IsNothing(Fields!DndCount.Value),0,Fields!DndCount.Value)

But if the query returns empty IsNothing() does not work.

5条回答
等我变得足够好
2楼-- · 2019-07-02 20:10

I have tried this code and it worked for me.

IIF(Sum(Fields!DndCount.Value)Is Nothing, "0", Sum(Fields!DndCount.Value))
查看更多
地球回转人心会变
3楼-- · 2019-07-02 20:10

You can also try to use the IsMissing expression of the field,

like this:

=IIF(Fields!Accounting_Amount.IsMissing, 0, Fields!Accounting_Amount.Value)
查看更多
Explosion°爆炸
4楼-- · 2019-07-02 20:12

Alternative solution to avoid using expressions, change the cell format to #,##0 in properties. Easier then to pair it up with count or sum.

查看更多
放我归山
5楼-- · 2019-07-02 20:14

Try this:

=IIF(Fields!DndCount.Value=0 OR 
IsNothing(Fields!DndCount.Value)=0 OR
Fields!DndCount.Value="null",0,Fields!DndCount.Value)
查看更多
Lonely孤独者°
6楼-- · 2019-07-02 20:18

Since IsNothing will return a True or False value you need to set your expression as:

=IIF(IsNothing(Field1) = True, 0, Field2)   

Hope it helps.

查看更多
登录 后发表回答