You could use variations on this theme:
SELECT M.*
FROM measurements AS M
WHERE M.Value>=All (
Select Value
From measurements
Where Time Between M.Time - #0:05# and M.Time + #0:05#
)
OR M.Value<=All (
Select Value
From measurements
Where Time Between M.Time - #0:05# and M.Time + #0:05#
)
This shows local maximas and minimas, highest or lowest in +- 5 minutes.
Cheers!
(°v°)
Main Topics
Browse All Topics





by: aburrPosted on 2007-06-27 at 07:01:12ID: 19372303
I am a bit unsure as to your example. You mention four data elements but your example shows only two or three. I am assuming that your example is two of your four columns.
It would appear that you have one maximum at 1:15. From your data it would be hard to say that 1:00 is a minimum but the suggestion below could be modified to identify it.
Extract your data and find the difference between each adjacent point. When that difference changes sign you have your max or min. (When the sign goes from + to you have a max, when from to + a min.)