techzone12
Technical User
I have a table called "Daily" (Daily data) that looks like this:
DateStamp KWH
11/6/2005 1867
11/7/2005 2001
11/8/2005 2023
.
.
A second table called "15_min" (15 minute data) looks like this:
[DateTime] KW
11/8/2005 00:00 am 201
11/8/2005 00:15 am 198
.
.
11/8/2005 11:30 pm 211
11/8/2005 11:45 pm 197
I want to do an insert into a third table called "totals" that looks like this:
DateStamp KWH
11/6/2005 2340
11/7/2005 2456
11/8/2005 2345
Where as an example:
totals.kWH for 11/8/2005 = sum(15_min.KW)/4 for the entire day of '11/8/2005' + daily.KWH for '11/8/2005'
i.e, The query will add all 15-minutes data from "15_min" table for the day of '11/8/2005' and then divide by 4. It will then do a straight addition of the resulting number to the KWH from "Daily" table.
How can I do this?
DateStamp KWH
11/6/2005 1867
11/7/2005 2001
11/8/2005 2023
.
.
A second table called "15_min" (15 minute data) looks like this:
[DateTime] KW
11/8/2005 00:00 am 201
11/8/2005 00:15 am 198
.
.
11/8/2005 11:30 pm 211
11/8/2005 11:45 pm 197
I want to do an insert into a third table called "totals" that looks like this:
DateStamp KWH
11/6/2005 2340
11/7/2005 2456
11/8/2005 2345
Where as an example:
totals.kWH for 11/8/2005 = sum(15_min.KW)/4 for the entire day of '11/8/2005' + daily.KWH for '11/8/2005'
i.e, The query will add all 15-minutes data from "15_min" table for the day of '11/8/2005' and then divide by 4. It will then do a straight addition of the resulting number to the KWH from "Daily" table.
How can I do this?