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

    Parameter query defaults (Access 2000)

    I have created a simple query that includes a date crtierion parameter "Between [From date:] And [To Date:]" to prompt for entry of a range of dates, but is it possible to refine this to provide an option for including all dates? Currently, the user can enter 1 Jan and 31 Dec each time, but an "Enter = any" option would be more convenient.

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

    Re: Parameter query defaults (Access 2000)

    You can do it like this:
    - Remove the Between ... and ... condition
    - Add a new column [From date:]
    - In the Criteria line for this column, enter

    Is Null Or <=[DateField]

    - Add a new column [To Date:]
    - In the Criteria line for this column, enter

    Is Null Or >=[DateField]

    Replace DateField with the name of the date field that originally had the Between ... and ... condition. The user can leave either or both of the parameter prompts blank. For example, to retrieve all data up to and including 1 Sep, leave the From date: parameter promt blank, and enter 1 Sep in the To date: parameter prompt. To retrieve all data, leave both parameter prompts blank.

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

    Re: Parameter query defaults (Access 2000)

    That works fine---thanks muchly.

    Initially, I got an error message that "The specified field [CreatedDateTime] could refer to more than one table listed in the FROM clause of your SQL statement", but prefixing the field name with the table name to make the reference unique fixed this.

Posting Permissions

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