2

I am trying to find out the median of a value in SSRS. I keep getting #Error. I place GetMedian() everywhere in my report. Header, Footer, Footer of the table with no luck

I am using the code from this post

to get the median but I think the issue is with when I try and get the values.

When I am trying to add the values I am using the following :

=Code.AddValue(DateDiff(dateinterval.Minute,
                        Fields!LAST_APPOINTMENT_DATE.Value,
                        Fields!TIME_PRINTED_FAXED.Value)
              )/60

I'm not sure if this will calculate properly as well as adding the value? Which could be my issue? Please let me know.

Pedram
  • 6,256
  • 10
  • 65
  • 87
SeanJohn
  • 187
  • 1
  • 2
  • 11
  • 3
    For one thing, you're probably trying to divide the datediff value by 60 but you're dividing addvalue by 60. And second, you didn't wrap the addvalue call with an aggregate like the instructions in the link said to do. – Rabbit Dec 17 '15 at 00:44
  • As @Rabbit has pointed out using the example in the link the function call to 'AddValue' function should probably look like =MAX(Code.AddValue((DateDiff(dateinterval.Minute, Fields!LAST_APPOINTMENT_DATE.Value, Fields!TIME_PRINTED_FAXED.Value))/60)) – SQLBobScot Dec 18 '15 at 15:36

0 Answers0