Grouping time in table by 15 minute intervals

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
 
A

Allen Browne

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.
 
V

Van T. Dinh

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.
 
J

James A. Fortune

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
 
J

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
 
A

Adam

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?
 
V

Van T. Dinh

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.
 
Top