Hi,
I have an IIF function in my textbox expression.This is my code.

IIF(IsNothing(Fields!Duration.Value) ,
"Not released ",Int((Fields!Duration.Value/12)).ToString()+ "Y " +(Int(Fields!Duration.Value) Mod 12).ToString() + "M")

But when Duration is null the true expression doesnt work instead it displays "#error".Can anyone help me to fix this?

Thanx in Advance

Recommended Answers

All 3 Replies

Use & operator to concat string.

=IIF(IsNothing(Fields!Duration.Value) ,"Not released ",Int((Fields!Duration.Value/12)).ToString() &  "Y "  & (Int(Fields!Duration.Value) Mod 12).ToString() & "M")

Thnx for the reply,but still it displays #error when the Duration fiels is null. But it works fine when there is a value in Duration.Do you have any suggestions?
Thnx in Advance

=IIF(IsNothing(Fields!Duration.Value),"Not released",(Fields!Duration.Value\12) & "Y "  & (Fields!Duration.Value Mod 12) & "M")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.