G
Guest
Hello,
I have a table that contain period begin date and period enddate as follows:
1106 11/01/ 2006 11/30/2006
1206 12/01/2006 12/31/2006
0107 01/01/2007 01/31/2007 etc
I am trying to do a rolling 12 month and created the following vba code but
I am getting an error that too few parameters. If I replace the
Forms!frmFinancial!cboEndDate with say #12/31/2006#, it runs okay. I guess I
need some help on the syntax - the result should be Mth1, Mth2 etc . The
begindate and enddate are two variables in the procedure.
pstrSQL = "SELECT pe, pebedt, peendt, Mth &
DateDiff('m',pebedt,Forms!frmFinancial!cboEndDate) " & _
"into pemonths FROM dbo_periodt " & _
"WHERE petime= 'CL' pebedt between " & "#" & begindate & "#" & " And
" & "#" & enddate & "#"
I have a table that contain period begin date and period enddate as follows:
1106 11/01/ 2006 11/30/2006
1206 12/01/2006 12/31/2006
0107 01/01/2007 01/31/2007 etc
I am trying to do a rolling 12 month and created the following vba code but
I am getting an error that too few parameters. If I replace the
Forms!frmFinancial!cboEndDate with say #12/31/2006#, it runs okay. I guess I
need some help on the syntax - the result should be Mth1, Mth2 etc . The
begindate and enddate are two variables in the procedure.
pstrSQL = "SELECT pe, pebedt, peendt, Mth &
DateDiff('m',pebedt,Forms!frmFinancial!cboEndDate) " & _
"into pemonths FROM dbo_periodt " & _
"WHERE petime= 'CL' pebedt between " & "#" & begindate & "#" & " And
" & "#" & enddate & "#"