Results 1 to 3 of 3
  1. #1
    ArvinFx is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    15

    Find a date between 2 dates

    This is the table:

    ID Machine Start_date End_date code
    1 2400 01-Jan-20 22-Jan-20 47
    2 2400 05-Dec-19 16-Jan-20 38
    3 800 01-Dec-19 31-Dec-19 C03
    4 800 01-Jan-20 15-Jan-20 963



    I need a query to find the row of 18-jan-20 for machine 2400 , which is ID no 1.
    Machine Start_date End_date
    2400 01-Jan-20 22-Jan-20

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    to clarify what you are asking you want a list of records which were 'running' on the 18th Jan.

    to do this you use the between criteria (assuming you are including start and end dates)

    Code:
    SELECT *
    FROM myTable
    WHERE #01/18/2020# BETWEEN myTable.Start_date and myTable.End_date
    note date format needs to be US format of mm/dd/yyyy

  3. #3
    ArvinFx is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    15
    thanks it Works

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

Similar Threads

  1. Replies: 1
    Last Post: 10-19-2018, 10:56 AM
  2. find out overlapping dates
    By HS_1 in forum Programming
    Replies: 3
    Last Post: 07-27-2018, 11:48 AM
  3. Find 2 most recent dates
    By cmiley in forum Queries
    Replies: 17
    Last Post: 01-19-2017, 04:57 PM
  4. Find gaps in Dates
    By soldat452002 in forum Queries
    Replies: 5
    Last Post: 07-31-2016, 03:57 PM
  5. Replies: 1
    Last Post: 12-22-2012, 12:38 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