Subtracting data of one time scale from data of a different time scale

Automattic

New Member
Joined
Mar 22, 2011
Messages
14
Hey all,

I have one set of data that comes in 15 min intervals that I need to average into 1 hour blocks (tbltest_hourly.[sngpressure]) so that I can subtract it by another data set that's comes in 1 hr intervals (tbltest_cronos.[sngpressure]). The time field is dtmdate for both tables.

The two child tables (tbltest_hourly and tbltest_cronos) are related to each other through a parent table (tblsiteid) that hosts all of the site names.

How do I go about averaging the 15 min data (yyyy/mm/dd hh:nn) so that I can perform operations with the 1 hr data?

If necessary I can fix this in excel (it's a bit messier), before importing, but I was hoping to do this in access.

Thanks in advance,

-A
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I did this using 2 queries. The first query grabs the hour that each data point arrives; the second groups and averages the result.

Based on tblTest with fields TimeStamp and Amount. TimeStamp is the field that records the time that you want to process.

First query, qryPartition:
Code:
SELECT tblTest.TimeStamp, tblTest.Amount, DateValue([TimeStamp]) AS RectDate, Int((TimeValue([TimeStamp])*24)) AS RectHour
FROM tblTest;

Second query, qryGrouping:
Code:
SELECT qryPartition.RectDate, qryPartition.RectHour, Avg(qryPartition.Amount) AS AvgOfAmount
FROM qryPartition
GROUP BY qryPartition.RectDate, qryPartition.RectHour;

Denis
 
Upvote 0
Hey Denis,

I tried out your solution and everything looked good. Since i'll also need to average by day at a later point, the queries you provided will be easily adaptable to the next scale.

Thank you very much,

-A
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,626
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top