Filtering by Month

  • Thread starter Thread starter Zane
  • Start date Start date
Z

Zane

I have a query that is filtering by month (i.e. type the
month you want the report from and it produces just for
that month. The SQL for it looks like:

WHERE (((Format([Modified Disclosure Date],"mmmm"))=
[Select]![Month])) OR ((([MAIN TABLE].[Modified
Disclosure Date]) Is Null) AND ((Format([Disclosure
Date],"mmmm"))=[Select]![Month2]));


I would like it to have a range, so that I type in the
range for both dates and it spits me out a list for say 3
months. Any help would be greatly appreciated.

Thanks
Zane
 
Zane

If you wanted a flexible date range, try:

WHERE ([Modified Disclosure Date]>= datevalue([StartDate])
and [Modified Disclosure Date]< (datevalue([EndDate])+1))
OR ([Disclosure Date]>= datevalue([StartDate]) and
[Disclosure Date]< (datevalue([EndDate])+1))

If you just wanted to enter in just the month, try

WHERE (month([Modified Disclosure Date])>= [StartMonth])
and month([Modified Disclosure Date])<= [EndMonth]) OR
(month([Disclosure Date])>= [StartMonth]) and month
([Disclosure Date])<= [EndMonth])

Have a great day.

Mark
 
Back
Top