I'm not sure if this is possible but I'm trying the run the following SQL from a VBA application in ACCESS DB. I'd like to INSERT a record into 'outputTable' with most of the data coming from a record in 'stagingTable'. However, two fields need to come from a form and I cannot figure out how to include those values into the INSERT statement.
sql = "INSERT INTO " & outputTable ([Date],[Carrier],[Division],[Code],[Status],[Total])
SELECT [Division],[Code],[Status],Sum([Claim]) AS [SumOfClaim]
FROM " & stagingTable & "
GROUP BY [Division],[Code],[Status];"
On the outputTable, the [Date] and [Carrier] values are missing. These would come from user input on a form. Is there a way I could add these values into to SQL statement?
Thank you