Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Date parameters (Access 2000)

    I need to include date range parameters in a crosstab query, so I have entered the following criteria on the date field.

    >=[Enter first date] AND <=[Enter last date]

    (I also entered the parameters in the Query Parameters list.

    However, this produced an error message: "The expression is typed incorrectly, or it is too complex to be evaluated ... etc."

    How can I correct this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date parameters (Access 2000)

    Try

    Between [Enter first date] And [Enter last date]

  3. #3
    New Lounger
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date parameters (Access 2000)

    You need to put a hash at the start and end of the date. For example >#1/1/2006# and <#1/2/2006#. From memory the date format is the same as defined in Windows. Either dd/mm/yy pr mm/dd/yy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date parameters (Access 2000)

    You need the hash characters # if you put literal dates in the Crtieria row. They are not needed, however, if you use parameters such as [Enter first date] or [Forms]![frmInput]![txtStartDate].

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Re: Date parameters (Access 2000)

    Thanks, Hans; however, this gives the same error message.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date parameters (Access 2000)

    This means that there must be some kind of other problem with your query. Can you post the SQL for the query, or a stripped down version of the database? See <post#=401925>post 401925</post#> for instructions.

  7. #7
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Re: Date parameters (Access 2000)

    After some experimentation, I discovered that the problem was that the parameter type needed to be set to Date/Time (as you can see, I still have a lot to learn!). I also discovered that apparently the parameters need to be defined in each query of a series based on this one, otherwise the user is prompted for them once for each additional query, is that correct?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date parameters (Access 2000)

    It depends on the query type. In some situations you must declare the parameters in each query.

  9. #9
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Re: Date parameters (Access 2000)

    OK thanks again, Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •