Search code examples
reporting-servicesssrs-2008

SSRS expression - If null value then return 0 instead of blank


I've seen a few examples but I just can't figure it out for my case. My expressions sums all values from field Total from the dataset AutoDeliveryCount. I need to reference the dataset since I'm using a few Total fields in my report. If the stored procedure returns null, how can I have my expression return 0 instead of a blank?

=Sum(Fields!Total.Value, "AutoDeliveryCount")

Solution

  • =IIf(IsNothing(Sum(Fields!Total.Value, "AutoDeliveryCount"))=True, 0, Sum(Fields!Total.Value, "AutoDeliveryCount"))