SUM BO.AccessionNumber <> MIN BO.AccessionNumber +((COUNT BO – 1)COUNT BO)/2
There is nothing wrong with using COUNT. However, I checked the formula and it does not seem to work for me. Consider a sequence 1,2,3. According to the formula the result is as follows:
1+2+3 <> 1+((3-1)3)/2
6 <> 1+(2*3)/2
6 <> 1+3
6 <> 4
If you are trying to determine the sum of arithmetic progression (that assumes consecutive numbers), I would say the formula should be this:
(MIN BO.AccessionNumber * 2 + COUNT BO – 1) * COUNT BO / 2
Alternatively, you can use another version that is based on values of the first and last elements in the series and therefore does not make assumptions about consecutive numbers:
(MIN BO.AccessionNumber + MAX BO.AccessionNumber) * COUNT BO / 2