Groups | Blog | Home
all groups > sql server reporting services > september 2007 >

sql server reporting services : NULL values - finding an alternative to the IIF statement


roy NO[at]SPAM mgk.com
9/26/2007 12:10:05 PM
since the IIF statement evaluates both the true and false conditions
regardless... I need to find a replacement to it...

my code is:

=IIF(Fields!SOURCE_TRANSACTION_KEY.Value = nothing, "", Fields!
SOURCE_TRANSACTION_KEY.Value.TOSTRING.SUBSTRING(3, 2))

I get the #ERROR value in my report for values that are null since the
SUBSTRING of a NULL value generates an error.

I've tried CHOOSE and the SWITCH and they behaved as IIF.

I do not want to handle this on the server side.

Any ideas?

Thanks
Carl Henthorn
9/26/2007 3:20:02 PM
you're really better off modifying the query code to replace NULLS with blank
strings before the rpt code even looks at it. anything else will be an epic
kludge.

[quoted text, click to view]
Mónica
9/27/2007 12:00:00 AM
And what about this?

=IIF(Fields!SOURCE_TRANSACTION_KEY.Value = nothing, "", Mid ("" &
Fields!SOURCE_TRANSACTION_KEY.Value,3, 2)

Hope this helps.


<roy@mgk.com> escribió en el mensaje
news:1190895795.174272.317940@g4g2000hsf.googlegroups.com...
[quoted text, click to view]

roy NO[at]SPAM mgk.com
9/27/2007 5:23:15 AM
On Sep 26, 5:20 pm, Carl Henthorn
[quoted text, click to view]

argh! was hoping to avoid that...
AddThis Social Bookmark Button