Suming data with time issues

CumbrianCanary

Registered User.
Local time
Today, 18:11
Joined
Sep 13, 2004
Messages
22
I have a database that holds a reading every ten minutes. I have been asked to sum them to give hourly and daily values.

I have easliy created a query to get the daily totals but can't seem to get the hourly ones.

The table has 3 fields, date, time and reading.

I am missing something really obvious here?

Thanks in advance for your help
 
Hi -

Give this a try, changing table/field names as appropriate.

Note: DATE, TIME and HOUR are all reserved words in Access and should not be used as field names.
Strongly recommend you rename your Date and Time fields.


Code:
SELECT
    tblReadings.MyDate
  , Hour([MyTime]) AS MyHour
  , Sum(tblReadings.Reading) AS SumOfReading
FROM
   tblReadings
GROUP BY
   tblReadings.MyDate
  , Hour([MyTime]);

HTH - Bob
 
Last edited:
Thanks for your help guys. The fields aren't really called time and date, I just used that to indicated the information they held.
 

Users who are viewing this thread

Back
Top Bottom