Share via

Date Parameter in Query - Pulling incorrect results (Access 2010)

Anonymous
2012-09-10T17:22:15+00:00

I want to pull results based on beginning and end dates, as entered in as ask query.  My date criteria is as follows:

            Between [Start date (dd/mm/yyyy)] And [End Date (dd/mm/yyyy)]

The query runs fine, but the results are not restricted to the specified dates.  What am I doing wrong?

Barb

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-09-10T18:19:08+00:00

You need some separator characters between the parts of the date before the query can process it into a real date value.  See if it works when you enter 9 Sept 12 or use the style in the prompt 9/sept/12 or any number of equivalent date styles.

Alternatively, you could take the next step and use a form with text boxes to enter the start and end dates.  Then the query criteria would look like:

Between Forms!theform.txtstart And Forms!theform.txtend

Doing it this way gives you another option where you can use code to convert an undelimited date to a real date for the query to use.

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-09-10T18:44:10+00:00

    Fantastic!  "01 sep 12" etc. works perfectly!  Thanks so much!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-09-10T17:49:02+00:00

    Regional setting is dd/mm/yyyy (Canadian).  Dates are entered as ddMMMyy and display that way.  However, the parameter query will not recognize date input of "09sep12".

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-09-10T17:38:25+00:00

    Sounds like your regional setting is using mm/dd/yyyy style dates or maybe the date field in its table is Text data type instead of Date/Time data type.

    Was this answer helpful?

    0 comments No comments