biannual and annual reports

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

Guest

I generate reports based on a date field and those dates either 6 months or
12 months prior to todays month. The filter works fine the last 6 months of
the year but now in January month(Now())-6) returns nothing. What do I need
to do?
 
Use
Month(DateAdd("m",-6,Date()))
This will first subtract 6 months from today's date and then find the month
number.
 
I used

[current tb test date] = Month(DateAdd("m",-6,Date()))

in the control souce as a filter and it returned no records

Thank you though
 
Apparently you are attempting to compare a date value [current tb test date]
to a number like 7. Maybe you need
Month([current tb test date]) = Month(DateAdd("m",-6,Date()))
You might also need:
Year([current tb test date]) = Year(DateAdd("m",-6,Date()))

--
Duane Hookom
MS Access MVP
--

Jeff C said:
I used

[current tb test date] = Month(DateAdd("m",-6,Date()))

in the control souce as a filter and it returned no records

Thank you though

Duane Hookom said:
Use
Month(DateAdd("m",-6,Date()))
This will first subtract 6 months from today's date and then find the
month
number.
 
Duane.....Thank you

I finally got the following to work thanks to your suggestion:

month [........]=month(DateAdd("m",-6,Date()))

Duane Hookom said:
Apparently you are attempting to compare a date value [current tb test date]
to a number like 7. Maybe you need
Month([current tb test date]) = Month(DateAdd("m",-6,Date()))
You might also need:
Year([current tb test date]) = Year(DateAdd("m",-6,Date()))

--
Duane Hookom
MS Access MVP
--

Jeff C said:
I used

[current tb test date] = Month(DateAdd("m",-6,Date()))

in the control souce as a filter and it returned no records

Thank you though

Duane Hookom said:
Use
Month(DateAdd("m",-6,Date()))
This will first subtract 6 months from today's date and then find the
month
number.

--
Duane Hookom
MS Access MVP
--

I generate reports based on a date field and those dates either 6 months
or
12 months prior to todays month. The filter works fine the last 6
months
of
the year but now in January month(Now())-6) returns nothing. What do I
need
to do?
 
Back
Top