Eljefegeneo
Still trying to learn
- Local time
- Today, 14:29
- Joined
- Jan 10, 2011
- Messages
- 904
I have the following code that opens the report correctly:
But when I try to set the filter for plus or minus two weeks:
Or
I keep getting a syntax error missing operator.
I don't know which code (or neither one) to use that is missing the "operator".
Code:
Daily Followup: DoCmd.OpenReport "rptSalesContactsOpen", acViewReport, , WhereCondition:="[FollowUpDate] = Date()"
Weekly Followup: DoCmd.OpenReport "rptSalesContactsOpen", acViewReport, , WhereCondition:="DatePart('ww',[FollowUpDate]) = DatePart('ww',Date()) "
Mothly Followup: DoCmd.OpenReport "rptSalesContactsOpen", acViewReport, , WhereCondition:="DatePart('m',[FollowUpDate]) = DatePart('m',Date()) "
But when I try to set the filter for plus or minus two weeks:
Code:
DoCmd.OpenReport "rptSalesContactsOpen", acViewReport, , WhereCondition:="[FollowUpDate] = Between DatePart('ww',-2,Date())And DatePart('ww',2,Date())"
Code:
DoCmd.OpenReport "rptSalesContactsOpen", acViewReport, , WhereCondition:="[FollowUpDate] = Between [FollowUpDate]('ww',-2,Date())And [FollowUpDate]('ww',2,Date())"
I don't know which code (or neither one) to use that is missing the "operator".