Filtering for previous months

J

Jeff C

I have a date field and want to filter based on either 6 months previous or
12 months previous ie: those with bi-annual checks or annual checks. My
expressions work fine the last half of the year but not the first half ie:
(now)() -6 when now =Jan. HELP PLEASE
 
A

Andi Mayer

On Tue, 4 Jan 2005 07:59:07 -0800, Jeff C <Jeff
I have a date field and want to filter based on either 6 months previous or
12 months previous ie: those with bi-annual checks or annual checks. My
expressions work fine the last half of the year but not the first half ie:
(now)() -6 when now =Jan. HELP PLEASE

try:
Dateserial(year(date),month(date)-6,day/date))
 
J

Jeff C

I am extracting the records by filtering a report in the control source with
"month([current tb test date])=month(Now())-6)"
which worked fine until we got to January.

I tried your solution and it returned operator/syntax error

Thank you for trying for me anyway
 
A

Andi Mayer

I am extracting the records by filtering a report in the control source with
"month([current tb test date])=month(Now())-6)"
which worked fine until we got to January.

I tried your solution and it returned operator/syntax error
does this mean you only want the Data for month=7 ?

month([current tb test date])=month(dateserial(2000,month(date)-6,1)

I used 2000 as a year, because for every year its the same
 
J

Jeff C

Thanks for your effort I ended up using the following:

month(DateAdd("m",-6,Date()))

Andi Mayer said:
I am extracting the records by filtering a report in the control source with
"month([current tb test date])=month(Now())-6)"
which worked fine until we got to January.

I tried your solution and it returned operator/syntax error
does this mean you only want the Data for month=7 ?

month([current tb test date])=month(dateserial(2000,month(date)-6,1)

I used 2000 as a year, because for every year its the same
 
Top