Here is an important parameter: "anytime that is within 10 minutes of each other."
Does this mean that you want to look at the results in 10 minute increments, and take the highest score (or eliminate the lowest score) for each ten minute increment, like:
Hound Number 999 score 35 Time 11:00
Hound Number 999 score 30 Time 11:05
Hound Number 999 score 25 Time 11:40
Hound Number 999 score 35 Time 11:41
Hound Number 999 score 30 Time 11:42
Hound Number 999 score 25 Time 11:43
Yields (just takes highest):
Hound Number 999 score 35 Time 11:00
Hound Number 999 score 35 Time 11:41
OR, yields (just eliminates lowest):
Hound Number 999 score 35 Time 11:00
Hound Number 999 score 35 Time 11:41
Hound Number 999 score 30 Time 11:42
Or, even more difficult, takes each record, compares it to every other record, and if any other record is within 10 minutes, it takes the highest or eliminates the lowest. Which is a huge problem if you are getting results every minute or less, or even within 5 minutes of each result. For example:
Hound Number 999 score 35 Time 11:00
Hound Number 999 score 30 Time 11:05
Hound Number 999 score 25 Time 11:06
Hound Number 999 score 20 Time 11:11
Would yield (highest):
Hound Number 999 score 35 Time 11:00
Hound Number 999 score 30 Time 11:05
since the first recordis highest within 10 minutes of itself, and the second record is highest within 10 minutes of the 11:11 record.
Are you using a function in some other application that does this? If so, what results is it returning?
This can all be done, but is fairly sophisticated. I hope there is another poster out there with some canned code or an elegant solution. There always seems to be.
mmcdonal
|