Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a field in my DB called "DateOpened". I need to run a query that will scan these dates and return to me, for example, all files opened between 2/1/<any year> and 2/28/<any year>. I tried using a * wildcard but Access does not allow for that. Thanks

In the Criteria line of the "DateOpened" field in your database, enter the following:
Between [Please Enter Starting Date] And [Please Enter Ending Date]
Then when you run the query, enter the dates in the same format as the field.

Thanks Jennifer,
I got that far - the problem is I need the query to pull for example, all data between those two time periods (2/1 - 2/28) but for all years 1995 - 2005. Is that possible or am I using the wrong command?

If you want to pull by month regardless of year then use the month (date) in your query. For February the value should be 2.

I have tried using that in several ways: ( =DateSerial(Month(2)); =(Month(2)), etc. but i must not be using the right syntax. Can you fill me in on what the proper statement would be for all February dates (Month(2)) for all years please. Thanks!

In the query in the field section put month (date) in the field section. In the criteria section you can put 2 (for february). If you want to select the month on the form then instead in the criteria seciton put [forms]![form name]![control name]. The form name is of course the name of the form and the control name is the name of the control that stores the month value. Keep in mind the control name has to store number values related to the month. You can set up a separate table for this and then have a combo box on the form display the month and hide the first column (numbers) so all you do is select the month and the number value is stored in the combo box. The query would look at the combo box to get the month value.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |