Query to Filter by mm/yyyy

  • Thread starter Thread starter DD
  • Start date Start date
D

DD

I need help designing two queries. The structure of my
field is a date field which includes on the month and year:

mm/yyyy

Query 1: I need to have only the records returned within
the same calendar year. So since we are in July, I need to
see all records only for 01/2004 through 7/2004.

Query 2: I need to have 12 months returned. So since we
are in July I will need to see 08/2003 through 7/2004.

I believe Query 2 will consist of a formula -11 but I
cannot figure out how to do this.

Thanks in advance.
 
Query 1: I need to have only the records returned within
the same calendar year. So since we are in July, I need to
see all records only for 01/2004 through 7/2004.
include one field in your query
Yr:year([yourDateFieldName])and set the filter to
=year(Now())

Query 2: I need to have 12 months returned. So since we
are in July I will need to see 08/2003 through 7/2004.

I would piut a filter in the criteria:
=>([yourDateFieldName]-365)
Hope this helps.
Fons
 
This caused major headaches for me but try this, format
date format([datefield],"mm,yyyy")
then
Between Date() And DateAdd("m",-12,Date())
-----Original Message-----
Query 1: I need to have only the records returned within
the same calendar year. So since we are in July, I need to
see all records only for 01/2004 through 7/2004.
include one field in your query
Yr:year([yourDateFieldName])and set the filter to
=year(Now())

Query 2: I need to have 12 months returned. So since we
are in July I will need to see 08/2003 through 7/2004.

I would piut a filter in the criteria:
=>([yourDateFieldName]-365)
Hope this helps.
Fons
-----Original Message-----
I need help designing two queries. The structure of my
field is a date field which includes on the month and year:

mm/yyyy

Query 1: I need to have only the records returned within
the same calendar year. So since we are in July, I need to
see all records only for 01/2004 through 7/2004.

Query 2: I need to have 12 months returned. So since we
are in July I will need to see 08/2003 through 7/2004.

I believe Query 2 will consist of a formula -11 but I
cannot figure out how to do this.

Thanks in advance.
.
.
 
Back
Top