GROUP ON 10 Min Intervals

  • Thread starter Thread starter Songoku
  • Start date Start date
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
 
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
 
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.
 
Back
Top