Results 1 to 6 of 6
  1. #1
    clew3 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    8

    Gaps in time in a schedule database

    I oversee tutors and often need to quickly see if a tutor is available for a specific subject at a specific location, weekday, and time. I created a database that tracks all this information to be used for a printed report. This report should not show the tutor's names, just the tutoring specialty availability.

    Click image for larger version. 

Name:	db.png 
Views:	16 
Size:	22.6 KB 
ID:	30942
    The query results in something like this:
    LocationA Monday Algebra 8:00am 1:30pm
    LocationA Monday Physics 12:00pm 4:30pm
    etc.

    This all works fine as long as the different tutors' time ranges overlap, but the minute they don't it all goes out the window since Min and Max aren't able to tell if there is a gap in time. If there is a gap in time, then I need the query/report to look more like this:
    LocationA Monday Algebra 8:00am 10:00am
    LocationA Monday Algebra 12:00pm 1:30pm
    etc.

    I played around a little bit with DMin and DMax, but it didn't seem to be the answer unless I'm not using them properly. I searched multiple forums and websites, but can't find a similar problem.

    Any help or ideas would be appreciated.



    Edit:
    Added some table/query screenshots.
    Click image for larger version. 

Name:	emptable.png 
Views:	12 
Size:	4.7 KB 
ID:	30951

    Click image for larger version. 

Name:	schedtable.png 
Views:	12 
Size:	7.7 KB 
ID:	30950

    Click image for larger version. 

Name:	query2.png 
Views:	12 
Size:	14.6 KB 
ID:	30952
    Last edited by clew3; 10-25-2017 at 10:07 AM. Reason: adding more info/screenshots

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    you say

    need to quickly see if a tutor is available for a specific subject at a specific location, weekday, and time
    how does this tie up with the schedules table? Is that table showing when they are teaching (so not available for any other subject) or does it just show they are available for any subject? Or is it one teacher, one subject? or what?

    Also it is very bad practice to name fields the same as tables- at least rename the tables in the plural (e.g. specialities) - and to use the same name for different datatypes (speciality again) - so you have an object called 'speciality' which might be a field, might be a number or it might be text. Your use of multivalue fields will also confuse things since they can be difficult to work with.

    You have shown some query results - you also need to show the source data that generated those results

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    clew3 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2012
    Posts
    8
    The Employees table just stores employee info: Name & Specialty which is a multi-value choice field.

    The Schedule table stores that employee's schedule by Day of the Week (so the schedule can be viewed chronologically, and because most employees have the same schedule for multiple days of the week this is setup as a multi-value choice field), their location on that day, and their time in and time out (Date/Time fields set to Medium Time). Then that has a relationship to the ID from the Employee table.

    So each employee can have multiple subjects they are tutoring. Each subject then is available during the hours between TimeIn and TimeOut. The point is to be able to key in an employee's time on an individual level, pick their subject areas (specialties), and then see a result of when that subject is available for tutoring.

    I'll upload some table screen shots in the original post.

  5. #5
    clew3 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2012
    Posts
    8
    Quote Originally Posted by pbaldy View Post
    I don't think that's it. That's looking for individual records, whereas I'm trying to aggregate them by Specialty. And that is entering a date into a form to check between, whereas my query should do it automatically with no input other than the table data itself.

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    looks like you need to use a Cartesian query - no joins. but don't think you can do it with multivalue fields

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

Similar Threads

  1. Replies: 1
    Last Post: 03-19-2015, 05:33 PM
  2. Employee Schedule Database Desgin
    By Bkper087 in forum Access
    Replies: 2
    Last Post: 01-10-2015, 01:41 PM
  3. Trying not to Schedule Classes around Lunch Time
    By boywonder381 in forum Programming
    Replies: 3
    Last Post: 09-12-2014, 03:43 AM
  4. Removing Gaps from Report
    By caseym in forum Reports
    Replies: 2
    Last Post: 03-25-2011, 04:07 PM
  5. Time Schedule display in access
    By snoopy2003 in forum Database Design
    Replies: 3
    Last Post: 03-23-2011, 04:41 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