Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Time Series (2003)

    I have two fields StartTime and EndTime which signify the start and end of telephone calls. How can I create a query that will split the day into fifteen minute intervals and count how many calls started during each interval? I want to be able to see all of the intervals, with counts of zero if no calls were received during that time period.

    Thanks, Andy.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Time Series (2003)

    1) Create a table tblIntervals listing all the time intervals. It might be easiest to create the data in Excel using the filldown feature, and import them into Access.

    <table border=1><td>TimeFrom</td><td align=right>00:00</td><td align=right>00:15</td><td align=right>00:30</td><td align=right>..</td><td align=right>..</td><td align=right>23:30</td><td align=right>23:45</td></table>
    2) Create a query qryData based on your table, and add a calculated field
    <code>
    T: Int([StartTime]*96)/96
    </code>
    Set the Format property for T to Short Time.

    3) Create a query based in tblIntervals and qryData.
    Join them on TimeFrom vs T
    Double click the join line and select the option to return all records from tblIntervals.
    Add TimeFrom and T to the query grid.
    Select View | Totals or click the Totals button on the toolbar to make the query into a totals query.
    Set the Total option for T to Count.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •