Grouping time in table by 15 minute intervals

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

Hi All,

I have a table with about 100k records, which I have grouped in a
query.

I have excluded the call time, however would like to include it and
group it by 15 minute intervals.

Is this possible?

Adam
 
In query design, enter this expression into the Field row of your query:
DateDiff("n", DateValue([Date1]), [Date1]) \ 15
replacing "Date1" with the name of your date/time field.

Depress the Total button on the Toolbar (upper Sigma icon), and group by
this field.
 
Try also:

IntervalNo: Int(TimeValue([Date1]) * 96)

--
HTH
Van T. Dinh
MVP (Access)



Allen Browne said:
In query design, enter this expression into the Field row of your query:
DateDiff("n", DateValue([Date1]), [Date1]) \ 15
replacing "Date1" with the name of your date/time field.

Depress the Total button on the Toolbar (upper Sigma icon), and group by
this field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a table with about 100k records, which I have grouped in a
query.

I have excluded the call time, however would like to include it and
group it by 15 minute intervals.
 
James said:
Van said:
Try also:

IntervalNo: Int(TimeValue([Date1]) * 96)

Try also:

IntervalNo: [Date1] * 96 Mod 96

James A. Fortune

Hmm... That should have given the same answers but it didn't. I'll
check it out. It's probably something small.

James A. Fortune
 
James said:
James said:
Van said:
Try also:

IntervalNo: Int(TimeValue([Date1]) * 96)

Try also:

IntervalNo: [Date1] * 96 Mod 96

James A. Fortune


Hmm... That should have given the same answers but it didn't. I'll
check it out. It's probably something small.

James A. Fortune

IntervalNo: Int([Date1] * 96) Mod 96

James A. Fortune
 
This doesn't do anything? I've put this into my query and it just
returns a blank value when viewing the query.

What am i doing wrong?
 
The expression is correct. Here is my test in the Immediate window:

?Now()
09/10/2005 21:48:16

?Int(TimeValue(Now()) * 96)
87

If you don't know how to use it in your query, post the Table details, what
you are trying to do in the Query and the SQL string of yout attempted
Query.
 

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

Back
Top