Advanced Filter w/date field

T

Tom Gettys

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.
 
A

Allen Browne

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.)
 
T

Tom Gettys

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.
 
A

Allen Browne

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.
 
Top