I would like to have a query run using a variable in the select part of the SQL. The variable allows the query to be dynamic. Here is where my code is at so far:
DoCmd.RunSQL "SELECT ExcelImportUnitsForecast.{put in variable}, [Price]*{variable name} AS Revenue" & _
"FROM ExcelImportUnitsForecast INNER JOIN test ON (ExcelImportUnitsForecast.SKU = test.SKU) AND ExcelImportUnitsForecast.Company = test.Company)"
How do I do this?
DoCmd.RunSQL "SELECT ExcelImportUnitsForecast.{put in variable}, [Price]*{variable name} AS Revenue" & _
"FROM ExcelImportUnitsForecast INNER JOIN test ON (ExcelImportUnitsForecast.SKU = test.SKU) AND ExcelImportUnitsForecast.Company = test.Company)"
How do I do this?