none
Boolean Expressions RRS feed

  • Question

  • I have a unusual problem, well it is unusual becaue i cannot understand it.

    I am retrieving the following data, Revenue, Sales, Commission, and calculating Commission Rate in the report itself.

    I got warnings that a textbox  that was attempting to calculate the Commission Rate was trying to divide  by zero.

    When I analysed the data, I realised that indeed there were instances when Revenue was 0.00 and therefore when calculating the commission rate, commission/revenue it returned an error.

    I then thought I'd do the following in the expression field

    =iif((Fields!RevenueGbp.Value = 0.00), "Zero", (Fields!Commission.ValueGbp/Fields!RevenueGbp.Value))

    However this does not work. However if i tried the following Boolean query

    =iif((Fields!RevenueGbp.Value = 0.00), "Zero", Fields!CommissionGbp.Value)

    it does work. In fact if I use any other identifier or use two field thats add, subtract or multiplied with each other it will work. The problem only arises is when I decide to divide two fields together.

    Strangely if the condition is satisfied - [Fields!RevenueGbp.Value = 0.00]  - it will still try to work out the division even though it should just return Zero!

    Anyone help?


    Monday, November 12, 2007 12:22 PM

Answers

All replies