How do i get a query to give me a 15 min sum from 5 m intervals

G

Guest

i have data with the columns: date, time and rain. The data is in 5 minute
intervals and i need it to sum up the data in 15 minute intervals. How do i
accomplish this in a query?
 
J

John Vinson

i have data with the columns: date, time and rain. The data is in 5 minute
intervals and i need it to sum up the data in 15 minute intervals. How do i
accomplish this in a query?

One way would be to take advantage of the fact that an Access
Date/Time field is stored as a Double Float number, a count of days
and fractions of a day. You could create a calculated field

QuarterHour: CInt([time] * 24 * 4)

This will have values from 0 for midnight - 12:15am, 1 for
12:15-12:30, ..., 95 for 11:45pm to midnight. You can Group By this
field in a totals query.

Note that Time and Date are both reserved words (for the builtin
Time() and Date() functions) and therefore are *not* good choices for
fieldnames - Access will get confused at some point!

John W. Vinson[MVP]
 
G

Guest

Maybe i am doing it wrong, but i am getting an error. i am suppose to do
this to the time field i already have in 5 minute intervals correct?

John Vinson said:
i have data with the columns: date, time and rain. The data is in 5 minute
intervals and i need it to sum up the data in 15 minute intervals. How do i
accomplish this in a query?

One way would be to take advantage of the fact that an Access
Date/Time field is stored as a Double Float number, a count of days
and fractions of a day. You could create a calculated field

QuarterHour: CInt([time] * 24 * 4)

This will have values from 0 for midnight - 12:15am, 1 for
12:15-12:30, ..., 95 for 11:45pm to midnight. You can Group By this
field in a totals query.

Note that Time and Date are both reserved words (for the builtin
Time() and Date() functions) and therefore are *not* good choices for
fieldnames - Access will get confused at some point!

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top