Sifting out 2 indentifying numbers in a report detail for labels to a sum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dbar10
    New Member
    • Nov 2008
    • 17

    Sifting out 2 indentifying numbers in a report detail for labels to a sum

    I have a tricky problem. I have a report that contains information about amounts paid for service and they have a RANumber that on each line with the amount. Then in the invoice header I am showing a text box with the total values for each of two RANumbers. I am getting the Sum of each of the two RANumbers just fine with:

    RA1Sum :=Sum(IIf([NPI]<>1780694984, 0,[TotalPaid]))
    RA2Sum:=Sum(IIf ([NPI]<>1649307471, 0,[TotalPaid]))

    Now the problem: I have another textbox to act as a label for each sum. The RANumber has to show for the RA1 and Show the RANumber for RA2. I tried this:
    RA1 Label: =IIf([NPI]<>1780694984,"" ,[RANum])
    RA2 Label: =IIf([NPI]<>1649307471,"" ,[RANum])

    This works fine if I only have values for one RANumber in the detail. But as soon as I have 2 then I get the Sum of the values for both, but I only get the label for the first RANumber, but the label for the second does not show up. I hope soomeone can understand what I am trying to do. I am stuck.
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    I am assuming you have only two RANumbers and they are 1780694984 And1649307471. If that is the case, this should work:

    RA1 Label: IIf(RA1Sum > 0, "RANumber 1780694984", "")
    RA2 Label: IIf(RA2Sum > 0, "RANumber 1649307471", "")

    Comment

    Working...