sql - iif blank show zero -


i have visual studio report want state if calculation box blank due there being no figures available on particluar project show zero.

my calculation :- =((sum(fields!totalcost.value, "accrued") + sum(fields!totalcost.value, "serv1")) / (sum(fields!quantity.value, "serv1") + sum(fields!quantity.value, "accrued"))
)

and want try , include iif statement in show 0 if blank.

any ideas on how best achieve aim?

so far have got =iif((sum(fields!totalcost.value, "accrued") + sum(fields!totalcost.value, "serv1")) / (sum(fields!quantity.value, "serv1") + sum(fields!quantity.value, "accrued"))
) = "" ,false,0 )
getting little confused.

most value not blank string nothing. try following construct:

=iif(isnothing(((sum(fields!totalcost.value, "accrued") + sum(fields!totalcost.value, "serv1")) / (sum(fields!quantity.value, "serv1") + sum(fields!quantity.value, "accrued"))), 0, ((sum(fields!totalcost.value, "accrued") + sum(fields!totalcost.value, "serv1")) / (sum(fields!quantity.value, "serv1") + sum(fields!quantity.value, "accrued"))) 

it's bit awkward since have repeat expression twice, avoid may want write custom function.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -