Advanced Filter w/date field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

There is a field in my table that contains dates.

I would like to use the Advanced Filter feature to see only those records
with a date in a given month.

So far I have been unsuccessful in figuring out the syntax for the criteria.

The Month() function takes a parameter of type date and returns the month
number, but I don't know how to say "use the date in the current field".

Month(*)=7 and Month(this)=7 both give me syntax errors.
 
In the Field row of the query, enter:
Month([MyDate])
substituting the name of your field for MyDate.

Then in the Criteria row, enter the number, e.g. 7.

Note that this will bring results from any July (not just this year.)
 
Thanks for your reply Allen. However, my question was about doing this using
the advanced filter feature, NOT a query. Do you know if there is a way to
do that?

Allen Browne said:
In the Field row of the query, enter:
Month([MyDate])
substituting the name of your field for MyDate.

Then in the Criteria row, enter the number, e.g. 7.

Note that this will bring results from any July (not just this year.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Tom Gettys said:
There is a field in my table that contains dates.

I would like to use the Advanced Filter feature to see only those records
with a date in a given month.

So far I have been unsuccessful in figuring out the syntax for the
criteria.

The Month() function takes a parameter of type date and returns the month
number, but I don't know how to say "use the date in the current field".

Month(*)=7 and Month(this)=7 both give me syntax errors.
 
I don't think I understand the problem here.

AFAIK, the Advanced Query window looks like the query design window, and you
can enter stuff into the Field row just as you can for a calculated field in
a query.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Tom Gettys said:
Thanks for your reply Allen. However, my question was about doing this
using
the advanced filter feature, NOT a query. Do you know if there is a way
to
do that?

Allen Browne said:
In the Field row of the query, enter:
Month([MyDate])
substituting the name of your field for MyDate.

Then in the Criteria row, enter the number, e.g. 7.

Note that this will bring results from any July (not just this year.)


Tom Gettys said:
There is a field in my table that contains dates.

I would like to use the Advanced Filter feature to see only those
records
with a date in a given month.

So far I have been unsuccessful in figuring out the syntax for the
criteria.

The Month() function takes a parameter of type date and returns the
month
number, but I don't know how to say "use the date in the current
field".

Month(*)=7 and Month(this)=7 both give me syntax errors.
 

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