expression when sum have minus number then show 0

  • I have textbox with expression

    =Sum(Fields!servicetotal.Value, "Service") - Sum(Fields!servicefee.Value, "Service")

    Got the correct result.

    If the result number is negative, then I need to show (display) 0.

    Can you help me? Thank you.

  • You'll need to use an IIf:

    =IIf(Sum(Fields!servicetotal.Value, "Service") - Sum(Fields!servicefee.Value, "Service") < 0, 0, Sum(Fields!servicetotal.Value, "Service") - Sum(Fields!servicefee.Value, "Service"))

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom A - Friday, January 4, 2019 1:21 PM

    You'll need to use an IIf:

    =IIf(Sum(Fields!servicetotal.Value, "Service") - Sum(Fields!servicefee.Value, "Service") < 0, 0, Sum(Fields!servicetotal.Value, "Service") - Sum(Fields!servicefee.Value, "Service"))

    Yay. thank you so much

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply