Results 1 to 3 of 3
  1. #1
    sumukhreddy is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    5

    query using two dates and time range

    hi All,



    first of all i would like to say thank you for your kind help for my previous problems.

    i need one more suggestion. i need to pull data from table, where the data needs to be limited to be inbetween a specific range of dates and times like, say ill need to see only those records that were entered sometime between 23-Mar-2016 3:00am to 24-Mar-2016 3:00am. (I work overnights, so i start on monday and go hometuesday for example). in the database i have 2 columns, both are set todate/time, one column currently holds just the date, and one holds just thetime. I tried as below:

    In query i've add a calculated field and then search against that
    Field: [SUB Date] + [SUB Time]
    Criteria: Between #DATE()-1 3:00AM # and #DATE() 3:00am#

    but i'm getting syntax error. please help me

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Between forms!frmMyForm!txtStartDate and forms!frmMyForm!txtEndDate

    on the form enter the dates into the boxes. Time too.
    if you want separate boxes ,combine the 2 boxes into the final one...
    TxtStartDate = txtStart1 & " " & txtTime1
    ...

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    double posting here already answered

    http://www.access-programmers.co.uk/...d.php?t=285565

    @sumukhreaddy - please read this thread

    http://www.excelguru.ca/content.php?184

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

Similar Threads

  1. Creating Range of Dates in a Form
    By melb in forum Forms
    Replies: 6
    Last Post: 03-16-2015, 02:32 PM
  2. Add a range of dates to a table
    By gemadan96 in forum Programming
    Replies: 3
    Last Post: 06-20-2014, 01:49 PM
  3. Replies: 14
    Last Post: 05-28-2014, 03:09 AM
  4. date range instead list of dates
    By wnicole in forum Reports
    Replies: 2
    Last Post: 11-28-2013, 03:43 AM
  5. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 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