• Hi everyone, not sure if anyone is still looking at this thread but recently I have been running into the following error. I inspected the data but I am not noticing anything unusual.

    Any input would be greatly appreciated.

    Thanks

    Msg 6522, Level 16, State 2, Line 2

    A .NET Framework error occurred during execution of user-defined routine or aggregate "Agg_Median":

    System.InvalidOperationException: Failed to compare two elements in the array. ---> System.ArgumentException: At least one object must implement IComparable.

    System.ArgumentException:

    at System.Collections.Comparer.Compare(Object a, Object b)

    at System.Array.SorterObjectArray.SwapIfGreaterWithItems(Int32 a, Int32 b)

    System.InvalidOperationException:

    at System.Array.SorterObjectArray.SwapIfGreaterWithItems(Int32 a, Int32 b)

    at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)

    at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)

    at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer comparer)

    at System.Collections.ArrayList.Sort()

    at Agg_Median.Write(BinaryWriter ToBeSerialized)