Hi,
I have a function in Access VBA which uses an SQL code to create an average table from an existing table.
The original table may look something like this:
Time Data_1
03/08/2010 12:41:20 10
03/08/2010 12:41:30 13
03/08/2010 12:41:40 15
03/08/2010 12:41:50 23
.
.
.
with many thousands of rows.
I'm trying to create a function that outputs a new table containing the average values of data_1 (in segments the user chose) - for 10 minutes:
Time AVG(Data_1)
03/08/2010 12:41:20 10
03/08/2010 12:51:20 23
03/08/2010 13:01:20 13
03/08/2010 13:11:20 25
.
.
.
so far I have:
the function is supposed to average the values in data_1 and group them by the time (converted into seconds) divided by the user picked number of minutes (the 60 is for seconds)
Can any one help?
Thanks in advance,
Izhar
I have a function in Access VBA which uses an SQL code to create an average table from an existing table.
The original table may look something like this:
Time Data_1
03/08/2010 12:41:20 10
03/08/2010 12:41:30 13
03/08/2010 12:41:40 15
03/08/2010 12:41:50 23
.
.
.
with many thousands of rows.
I'm trying to create a function that outputs a new table containing the average values of data_1 (in segments the user chose) - for 10 minutes:
Time AVG(Data_1)
03/08/2010 12:41:20 10
03/08/2010 12:51:20 23
03/08/2010 13:01:20 13
03/08/2010 13:11:20 25
.
.
.
so far I have:
Code:
SQLrs = "SELECT [Time], AVG(Data_1) AS 'AVG(Data_1)'" SQLrs = SQLrs & " INTO T_Average FROM T_Export" SQLrs = SQLrs & " GROUP BY (time_in_seconds/" & AvNum & "/60)" DoCmd.RunSQL SQLrs
Can any one help?
Thanks in advance,
Izhar
Comment