In order to filter a report using preset date ranges you must perform two steps. The first is to setup your
query with special field specifiers that tell the report writer where to insert the dates. The second step is to
write code that replaces the field specifiers in your query with actual date values.
rpt.Sections("Detail").Controls("DataControl1").Source =
Replace(rpt.Sections("Detail").Controls("DataControl1").Source,"<<startdate>>",CStr(swcsAssistant.Get
Date(9)))
rpt.Sections("Detail").Controls("DataControl1").Source =
Replace(rpt.Sections("Detail").Controls("DataControl1").Source,"<<enddate>>",CStr(swcsAssistant.Get
Date(10)))
Replace GetDate(9) and GetDate(10) with the specific values you need. See Notes for more information.
1 = Last month start date
2 = Last month end date
3 = Last week start date
4 = Last week end date
5 = Month start date; Pass a date as the first parameter.
6 = Month end date; Pass a date as the first parameter.
7 = Current month start date
8 = Current month end date
9 = Current week start date
10 = Current week end date
11 = Week start date; Pass a date as the first parameter.
12 = Week end date; Pass a date as the first parameter.
13 = Recent start date (3 weeks ago)
14 = Recent end date (3 weeks from now)
15 = Today start date
16 = Today end date
17 = Yesterday start date
18 = Yesterday end date
19 = This year start date
20 = This year end date