Results 1 to 4 of 4
  1. #1
    pjdube is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    May 2017
    Posts
    25

    Between two Dates AND Time! Help

    Hi again!

    Okay, I have been trying to figure out how to get certain records between two dates and times.

    On the Date/Time column I have put the below criteria:

    Between Date()+(7-Weekday(Date(),6)) And Date()-Weekday(Date(),6)

    This works great with getting ALL the records from the last Thursday to the upcoming Thursday, which is partially what I want.

    But now I am trying to figure out how to be able to ALSO get it from a certain time range.

    My week ends on Thursday at 2pm, so clearly if I can grab all records from last Thursday after 2pm to this upcoming Thursday before 2pm then I can see my progress.

    Yes, the entire column is Date/Time stamped (i.e. 8/13/2020 10:29:59).

    Can anyone help or at least point me in the right directions so that I can figure this out?



    Thanks!

    Phil

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    A couple of thoughts. First, I've seen instances where the reverse didn't work right, so I always put the lower value first in a Between statement. You should be able to add the time:

    ?Date()-Weekday(Date(),6) + #14:00:00#
    8/13/2020 2:00:00 PM
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pjdube is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    May 2017
    Posts
    25
    pbaldy,

    Perfect! It worked! Exactly what I wanted.

    Phil

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Need to find time balances and dates
    By UT227 in forum Programming
    Replies: 8
    Last Post: 07-24-2020, 11:45 AM
  2. Calculate time between dates.
    By chriswrcg in forum Access
    Replies: 5
    Last Post: 11-11-2018, 11:17 AM
  3. query using two dates and time range
    By sumukhreddy in forum Queries
    Replies: 2
    Last Post: 03-24-2016, 05:30 AM
  4. Replies: 2
    Last Post: 03-01-2016, 04:48 AM
  5. Replies: 3
    Last Post: 11-19-2013, 11:48 AM

Tags for this Thread

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