G
googlinggoogler
Hi
I'm trying to do a rolling average on data that is ordered by a date
time column.
I'm after adivce about how best to do this, I've tried this -
SELECT Time, ValueX, (HOUR(Time) * 3600 + Minute(Time) * 60 +
Second(Time)) As TickTock
(SELECT Avg(ValueX)
FROM My_Table
WHERE TickTock Between (TickTock) AND (TickTock) + 30) AS
RollingAverage
FROM My_Table;
Basically my thinking was that it would be easier to work on this
datetime data as Seconds, So that my rolling average can be based on
10, at 3 second intervals
When I try this I get nothing in my RollingAverage box and also a pop
up asking for parameters... I'm very confused by this as ultimatly I
will be coding this into an application
Can anyone offer any pointers?
Thanks
David
I'm trying to do a rolling average on data that is ordered by a date
time column.
I'm after adivce about how best to do this, I've tried this -
SELECT Time, ValueX, (HOUR(Time) * 3600 + Minute(Time) * 60 +
Second(Time)) As TickTock
(SELECT Avg(ValueX)
FROM My_Table
WHERE TickTock Between (TickTock) AND (TickTock) + 30) AS
RollingAverage
FROM My_Table;
Basically my thinking was that it would be easier to work on this
datetime data as Seconds, So that my rolling average can be based on
10, at 3 second intervals
When I try this I get nothing in my RollingAverage box and also a pop
up asking for parameters... I'm very confused by this as ultimatly I
will be coding this into an application
Can anyone offer any pointers?
Thanks
David