Results 1 to 5 of 5
  1. #1
    wrayman is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2016
    Posts
    46

    Weird Behavior on Time

    I am just building a simple database for ordering glucose readings.

    glucose.accdb

    I have three queries to start with.



    Morning Between #8:00:00 AM# And #12:00:00 PM# (Criteria for Time Field, works fine returns correct data)
    Afternoon Between #12:00:00 PM# And #6:00:00 PM# (Criteria for Time Field, works fine returns correct data)


    Evening Between #6:00:00 PM# And #1:00:00 AM# Doesn't work right returns values outside the parameter

    I have attached the database, hard for me to figure out what is happening.

    Database also available here if the attachment didn't work (new to forum) http://mcltech.com/access/glucose.accdb http://mcltech.com/access/glucose.accdb

    If you run the queries you will see what I mean, in the Evening Query there are times from everywhere

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe you need to include the date if you are going to use criteria from one afternoon to the next morning.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    First off, "Date" and "Time" are reserved words in Access and shouldn't be used as object names. Plus, they are not descriptive - "Date" of what? "Time" of what??
    (and no spaces in field names)

    The problem is because you don't have a date component in the "Time" field. You are searching only on the "time" field and the ending time is in the next date (1 AM).
    You should really only have one date/time field.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe this:
    Attached Files Attached Files

  5. #5
    wrayman is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2016
    Posts
    46
    Yep, you all are correct, wasn't thinking.

    Thanks ssanfu for providing me with the code.
    Last edited by wrayman; 10-05-2016 at 05:06 PM. Reason: Fixed

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

Similar Threads

  1. Replies: 4
    Last Post: 07-20-2016, 03:04 PM
  2. Weird behavior of report on excel export
    By Romio in forum Reports
    Replies: 1
    Last Post: 12-15-2015, 12:52 PM
  3. Enter Key Behavior
    By jtm013 in forum Forms
    Replies: 8
    Last Post: 12-22-2014, 02:27 PM
  4. Ubnormal SUM behavior
    By spleewars in forum Forms
    Replies: 1
    Last Post: 04-10-2012, 10:27 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