Results 1 to 4 of 4
  1. #1
    SFGiants21256 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    4

    Filter Query to display who is supposed to be working based on time of day

    Hello,



    I'm trying to filter a query based on the current time and when an employee is supposed to be at work. The difficult variable is when the persons shift goes over midnight and they are supposed to be off. I can currently only get the filter to work correct based on the day and not the time. For example, if the shift is from 1830-0630 it is great until the days you are supposed to be off work. If I filter it by day then when we cross over midnight the person is supposed to be at work. Therefore it does not calculate who is supposed to be at work correctly.

    Below is a small sample of the database.

    I should add that I'm not very good at access.


    Accouuntability_V2.zipAccouuntability_V2.zip

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    To add time, you must use the ENTIRE date/time number (1/2/15 1am) - (1/1/15 11am) THEN the calculations work correctly.
    But filtering on a single time is tricky because it must be EXACT to the second, if you record seconds. Ranges maybe?

  3. #3
    SFGiants21256 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    4
    Would a range help to see if the current time is within that range? I tried: Time() between [shift start] and [shift end] but that didn't work.

  4. #4
    SFGiants21256 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    4
    Here is an earlier version of the database.
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 3
    Last Post: 06-18-2014, 10:40 AM
  2. Fields displaying when not supposed to
    By Mik2045 in forum Forms
    Replies: 9
    Last Post: 10-01-2013, 01:37 PM
  3. Filter not working the first time
    By NISMOJim in forum Programming
    Replies: 4
    Last Post: 07-07-2012, 06:38 PM
  4. Query-Display next time an event occurs
    By younggunnaz69 in forum Queries
    Replies: 2
    Last Post: 10-23-2011, 05:08 PM
  5. Query based form not working
    By Tewhano in forum Queries
    Replies: 1
    Last Post: 10-22-2010, 08:30 AM

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