Results 1 to 6 of 6
  1. #1
    hardleydirt is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    3

    Query Design Problem

    I have a table that has several fields that are check box's (data type Yes/No - Format true/False). I am trying to run a Query where you are prompted for input. The Criteria is - Between [Start Date] And [End Date] and =[True or False].

    When the Query is run I type a date range for the 1st prompt and then True or False for a 2nd prompt and get this error.



    "This expression is typed incorrectly, or it is too complex to be evaluated. For Example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables. HUM?????

    Anyone have any ideas what is wrong?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Between [Start Date] And [End Date] and =[True or False].
    What is field is True or False? There has to be a field name associated with the [True or False].

    Looking at part of the criteria, you would have

    Code:
    WHERE [HireDate] Between [Start Date] And [End Date]
    when you execute the query, you get prompts for the start date and end date. [Start Date] is So the criteria becomes

    Code:
    WHERE [HireDate] Between #1/1/2011# And #12/31/2011#

    You need the criteria to be something like

    Code:
    WHERE [HireDate] Between [Start Date] And [End Date] AND Check1 = [True or False]

    Because there are no fields/controls named [Start Date], [End Date] or [True or False], you get a prompt to enter the criteria values.


    Hope this makes sense....

  3. #3
    hardleydirt is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    3
    Yea major confusion - not a very good programer - see attached image - The Date Received field is data type Date/Time, the Stand Alone field has data type Yes/No on the table design page the format for the Stand Alone shows True/False (I changed this to Yes/No) but same results. If I only use the date filed it works fine - except it won't sort correctly on the date which is another weird issue (tried ascending sort, sorted the table nothing).
    Click image for larger version. 

Name:	Capture.JPG 
Views:	9 
Size:	37.4 KB 
ID:	10025

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Even though "StandAlone" is defined in the table as "Yes/No" (aka Boolean), it is really a number. Access defines a constant "True" as -1 and False as 0 (Zero).

    Run your query and when the prompts appear, enter the dates then enter -1 for the [True or False] prompt.

  5. #5
    hardleydirt is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    3
    Steve - YOU are correct - It works GREAT - Well the next step in my query has a hang up - I wanted to use two Yes/No prompts on to separate fields the Stand alone one and another one - but it seems it will only popup for one of the fields - going to have to rethink things I guess.

    But thanks so much for your answer.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I use a form instead of input prompts. You have more control over what happens.
    When you click a button or initiate the query, the code will create the "WHERE clause" or the query will look at the form to get the criteria for the query.

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

Similar Threads

  1. design problem
    By masoud_sedighy in forum Database Design
    Replies: 1
    Last Post: 12-15-2011, 11:22 AM
  2. complex design problem
    By Madmax in forum Access
    Replies: 2
    Last Post: 12-09-2011, 08:25 AM
  3. design problem
    By marianne in forum Database Design
    Replies: 7
    Last Post: 05-26-2009, 07:25 PM
  4. Table design problem
    By wasim_sono in forum Database Design
    Replies: 0
    Last Post: 04-08-2009, 06:21 AM
  5. Forms design problem
    By GeorgeD in forum Forms
    Replies: 2
    Last Post: 05-08-2008, 12:28 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