GROUP ON 10 Min Intervals

S

Songoku

I have a tabel that contains 400+ entries each on a different time of day the
time column is as follows dd:mm:yy what I would like is to group in intervals
of 10 minutes how can I go about this in access 2000?

Thnxks in advance
 
M

Michel Walsh

DateDiff("n", date_time1, date_time2) returns the number of minutes between
the two dates, so:


SELECT dateAdd("n", 10* (DateDiff( "n", #1/1/1900#, YourDateTime) \ 10 ),
#1/1/1900#), COUNT(*)
FROM yourTable
GROUP BY dateAdd("n", 10* (DateDiff( "n", #1/1/1900#, YourDateTime) \ 10 ),
#1/1/1900#)


as example, will count the number of records in each interval. Basically the
computed expression get the number of minutes between the date_time in the
field and the first of January 1900, round that down to a multiple of 10,
and add that to the firs of January 1900 to get the interval in an easy
readable (for a human) value.




Vanderghast, Access MVP
 
J

Jerry Whittle

Instead of doing it in a query, consider using a report. The report's sorting
and grouping options can easily group on time intervals such a 10 minutes.
 

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