Results 1 to 3 of 3
  1. #1
    ng1751 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    2

    Count consecutive records with multiple criteria

    Hello all,

    I am trying to construct a query that looks for an employee with the code "AVAL" for 5 consecutive 15 min time intervals. My columns appear as:

    State_Time |Employee| Code| Nominal_Date|
    1/1/2012 7:45:00 AM| Employee1| OFF| 1/1/2012
    1/1/2012 8:00:00 AM| Employee1| AVAL| 1/1/2012
    1/1/2012 8:15:00 AM| Employee1| NOAVAL| 1/1/2012
    1/1/2012 8:30:00 AM| Employee1| AVAL| 1/1/2012
    1/1/2012 9:00:00 AM| Employee1| NOAVAL| 1/1/2012

    The database usually consists of 30 days worth of dates, the 15 min intervals go until 10:00:00 PM, and there are roughly 100 employees at any given time. The desired result is to return the dates where this is true for each interval. i.e. if Employee1 shows AVAL for 7:45:00 AM, 8:00:00 AM, 8:15:00 AM, 8:30:00 AM, 8:45:00 AM, 9:00:00 AM on 1/5/2012 then they are able to take an 8AM appointment on 1/5/2012 with prep time from 7:45-8AM and query shows as:

    Interval Date Employee


    7:45:00 AM 1/5/2012 Employee1

    Result must be done by query and no VBA.
    Thanks in advance for your help and let me know if I need to clarify further!

  2. #2
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    Quote Originally Posted by ng1751 View Post
    Result must be done by query and no VBA.
    i don't think you can do it, sir. even with stacked queries. good luck though!

  3. #3
    ng1751 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    2
    I believe this post is trying to do a similar task with min/max times and comparing the previous records to each other. I am having trouble tailoring it to my situation. Any thoughts?

    https://www.accessforums.net/queries...data-5680.html

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-24-2012, 06:19 PM
  2. distinct count with criteria and max date
    By TheShabz in forum Queries
    Replies: 3
    Last Post: 09-23-2011, 06:08 AM
  3. multiple records with consecutive dates
    By sotssax in forum Forms
    Replies: 2
    Last Post: 07-26-2011, 04:23 AM
  4. Replies: 1
    Last Post: 07-13-2011, 11:00 AM
  5. Replies: 2
    Last Post: 05-09-2011, 06:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums