Ben_Entrew
Registered User.
- Local time
- Today, 08:01
- Joined
- Dec 3, 2013
- Messages
- 177
Hi all,
how can I use the column repmonth in the following statement?
repmonth is as a string declared and given by the user, in my case repmonth = 112013.
Thanks in advance.
Regards,
Ben
how can I use the column repmonth in the following statement?
repmonth is as a string declared and given by the user, in my case repmonth = 112013.
Thanks in advance.
Regards,
Ben
Code:
Public Sub TEST2()
DoCmd.RunSQL "SELECT PPC_REPORT.Reporting_Month, Report_Products.Division, Report_Products.Product_Class, PPC_REPORT.Sales_Quantity, Sales_QUANTITY_BP_2013.'" & repmonth & "' , Sales_QUANTITY_BP_2013.Total, Sales_Quantity_'" & CF_PERIOD & "'.' & repmonth & "', Sales_Quantity_'" & CF_PERIOD & "'.Total INTO QUANTITIES_TEMP " & _
" FROM ((Report_Products LEFT JOIN PPC_REPORT ON Report_Products.Product_Class = PPC_REPORT.Product_Class) LEFT JOIN Sales_QUANTITY_BP_2013 ON Report_Products.Product_Class = Sales_QUANTITY_BP_2013.[Product Groups]) LEFT JOIN Sales_Quantity_'" & CF_PERIOD & "' ON Report_Products.Product_Class = Sales_Quantity_'" & CF_PERIOD & "'.[Product Groups]"
End Sub