Results 1 to 2 of 2
  1. #1
    pbaccess is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    2

    Problems with date range in query

    Hello, I am trying to create a query where the user can enter a date range and receive a list of records filtered by that date range. The column header is "Date" and the criteria field I have as: Between [Enter Start Date] and [Enter End Date]. This normally works when the user enters 1/1/14 and 1/31/14 as start and end dates for example. however, the table I am linked to with an ODBC connection lists the dates in the following format: 12/26/2013 6:15:11 PM and it will only return records if I enter the full date like 1/1/14 12:00:00 AM and 1/31/14 11:59:00 PM. This is cumbersome for the user and if you type just 1/1/14 and 1/31/14 no records are returned.



    Is there any way around typing the full long date? I do not know VB, I only know how to use query design.

    Thanks in advance!

    pb

  2. #2
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    One solution would be to base the input critera on form data,
    form name = date_form
    2 fields, [from_date] and [to_date] in the properties for both fields you can select the format as you need, then use the build option in the query criteria... between [forms]![date_form]![from_date] and [forms]![date_form]![to_date]
    use the wizard to create a command button on the form to run the query, under miscellaneous select run query, pick the query from the list.
    then, enter the 2 dates and click the button.

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

Similar Threads

  1. Query for date range
    By BRZ-Ryan in forum Queries
    Replies: 23
    Last Post: 02-05-2014, 09:08 PM
  2. Query for Range to encompass given date
    By Mattbro in forum Queries
    Replies: 2
    Last Post: 12-30-2013, 08:15 AM
  3. Graph date range from query
    By dhicks19 in forum Access
    Replies: 1
    Last Post: 06-29-2012, 12:26 AM
  4. Date Range Query
    By need_help12 in forum Queries
    Replies: 7
    Last Post: 04-25-2012, 01:38 PM
  5. Run query by date range
    By ARickert in forum Access
    Replies: 2
    Last Post: 06-23-2011, 10:54 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