Listing just a single month's events from a table over a number of years

  • Thread starter Thread starter jimsunz
  • Start date Start date
J

jimsunz

In Access I have a table of events with one column having the date
dd/mm/yyyy.
I want to create a query that, for example, lists all the events that
took place in the
month of February in all years.
so it would extract 12/02/1999, 25/02/2003 and so on.

And then later,perhaps all the November events, etc.

Thanks for your help.
Jim.
 
Jim

In a blank column in the design view of your query, make a calculated
field like this...
CritMonth: Month([YourDateField])
.... and in the criteria of this column, put 2

If you want to do this for whichever month the user selects, you can do
it like this.... On a form, put an unbound textbox where the usr will
enter the number of the month required, e.g. 11 for November, and then
in the criteria of the CritMonth field in the query, you can put the
equivalent of...
[Forms]![NameOfForm]![NameOfTextbox]
 
In Access I have a table of events with one column having the date
dd/mm/yyyy.
I want to create a query that, for example, lists all the events that
took place in the
month of February in all years.
so it would extract 12/02/1999, 25/02/2003 and so on.

And then later,perhaps all the November events, etc.

Thanks for your help.
Jim.

Put a calculated field in a Query by typing:

EventMonth: Month([datefield])

Put a criterion on the field of

[Enter month number:]

The field will contain integers 1 to 12; selecting 2 will get all of
February's data in any year.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top