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"))
getting little confused.
) = "" ,false,0 )
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
Post a Comment