Results 1 to 2 of 2
  1. #1
    GAccess is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    38

    Date Query - Using "Between" and "AND"

    Hi all,

    Side note: From Datapigs, the instructor shows that you should probably program any queries that will be using "AND" within the criteria. I wouldn't know how to code in VBA in order to use a query.

    My level is beginning intermediate, so I still need a lot of things spelled out to me.

    PLEASE HELP!

    I have a search form. Within the search form the user can search for cars sold in a given period of time.

    I have a table.. which lists the dates that each car was sold.

    DateSold<--column name

    The query I have created is not working properly. I keep getting the error code 3071- The expression is typed incorrectly, or it is too complex to be evaluated.


    In my query I have - DateSold from a cars table. In the criteria row, I typed Between Datesold.beg AND Datesold.end. I want for the query to search within the column DateSold and return all cars sold within a specific period.

    Example

    DateSold
    1/1/2001 A
    1/2/2001 B
    3/4/2001 C
    3/8/2001 D
    3/9/2001 E
    3/10/2001 F

    if i type in i want to search between 3/1/2001 to 3/12/2001------ CDEF should pull up.


    Hope someone can help me!

  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
    At it simplest:

    Between [Enter start date] And [Enter end date]

    but most of us use forms to gather user input since you have a lot more control there.
    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. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  2. Replies: 4
    Last Post: 03-14-2012, 09:05 AM
  3. Replies: 8
    Last Post: 08-05-2011, 02:55 PM
  4. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  5. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 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