joining rows to avarage row

civileng

Registered User.
Local time
Today, 18:35
Joined
Apr 15, 2013
Messages
12
Can anyone help me with a way to join 6 rows into one and calculating avarage.

So I have temperature data in rows in time intervals of 10 minutes. I would like to join rows in one hour interval, and at the same time calculate avarage temperature in temperature field.

zajeta-slika.jpg
 
Code:
SELECT Hour([Datum]) AS H, Sum(Temperatures.T1) AS SumOfT1, Sum(Temperatures.T2) AS SumOfT2, Sum([T1])/6 AS A1, Sum([T2])/6 AS A2
FROM Temperatures
GROUP BY Hour([Datum]);
Where T1, T2 are your first 2 fields with temperatures and A1, A2 the first 2 averages.
This work only for 6 records/hour.
 
:) Indeed Pat. I'm stupid, because I already know about this function.
 

Users who are viewing this thread

Back
Top Bottom