Results 1 to 4 of 4
  1. #1

    y2001- Access 2000

    I have a parameter query in which it asks for the report begin date and report end date which are used to select the records to be included in a report. The fields in the select query are ReportBeg: [RptBegDate] and ReportEnd: [RptEndDate]. The properties for both fields are set to Short Date (99/99/0000;0;_). The select query works correctly for dates which do not include 2001.

    As a work around, I created 2 date fields in a table: ReportBeg and ReportEnd. When the dates are entered into these fields manually and then the select query is run, it works properly with 2001 dates.

    Any assistance in why the select query does not work properly in the first instance would be greatly appreciated. The select query compares dates using the greater than and less than symbols to determine the record to be included.


  2. #2
    Hannah W

    Re: y2001- Access 2000

    This is may or may not help...
    In select querys you cannot use any fieldnames in the [square brackets] for prompts as this generally messes everything up.
    It took me hours to work this out when I got sent a database "That doesnt seem to be working now Ive made a few changes to it"

  3. #3

    Re: y2001- Access 2000

    Thanks Hannah for the idea. I am still struggling with how to work around using the square brackets. Any suggestions would be appreciated.

    What I'm trying to do is run a report that asks for the beginning and ending dates of the report period. The records are then selected by using the inputed dates.



  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: y2001- Access 2000

    If you fully reference the field, including the table name (i.e., Expr1: MyTable.[MyField]) , the query engine will recognize that square brackets indicate a field. If you put square brackets around a string in an expression (i.e., Expr1: [MyField]) Access thinks you're asking for a parameter, since square brackets without a full reference also indicate a parameter. One possible exception is if your field name contains spaces, in which case, you must use square brackets around it in all expressions, but you'd better reference its parent table as well.

    You need to post the SQL for the query so that someone can help you straighten it out. Just view the query in SQL view and copy and paste the SQL into your message.

Posting Permissions

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