Unanswered: Stored procedure using vba and ado command object or access pass through
can anyone help me write a stored procedure or passthrough query for the following
INSERT INTO ProcessorPaymentReportx ( MaxOfprocessorName, batchAmount, processorid )
SELECT Max(processors.processorName) AS MaxOfprocessorName, Sum(transactions.TransactionAmount) AS batchAmount, processors.id
FROM processors, transactions
WHERE (((processors.id)=95) AND ((transactions.transactionType_id)=4) AND ((transactions.ProcessedOn) Between '9/1/2009' And '9/1/2010'))
GROUP BY processors.id;
those two dates I hardcoded to see the statement actually work from within studio mgr.
but I need to pass a parameter for them
but if it is a stored proc then I need to pass in the variables -
I would rather use a passthrough but i am having difficulty with all the syntax (querydef.sql etc)
and my real choice is the ado command object but I eep getting syntax erors near "," and b y the time I whittle out every line I have a blank window but the above syntax runs and executes fine using the execute button
I need this done by morning and I am just too fatigued to get it!
Got a new spec on friday evening and the report has to use a passthrough or sproc no recordset anything? and I am so used to dao and ado - the command object is acceptable but I can't pass in the params for some reason.