What kind of recordset is created when set to a command.execute statement?
And then a recordset is created with
David Paulson
Code:
Set cmdGSTSalesAmount = New ADODB.command
cmdGSTSalesAmount.ActiveConnection = cnAccounting
cmdGSTSalesAmount.CommandText = "SELECT sum(TotalGSTSales) as MonthTotalGSTSales,sum(TotalNonGSTSales) as MonthTotalNonGSTSales, sum(GSTAmount) as MonthGSTTotal, sum(DebitTotal) as MonthInvoiceAmount FROM Invoices WHERE Printed = True AND DebitTransType = 'I' AND InvoiceDate BETWEEN ? AND ?"
cmdGSTSalesAmount.CommandType = adCmdText
cmdGSTSalesAmount.Prepared = True
Set prm = cmdGSTSalesAmount.CreateParameter("Start", adDate, adParamInput)
cmdGSTSalesAmount.Parameters.Append prm
Set prm = cmdGSTSalesAmount.CreateParameter("End", adDate, adParamInput)
cmdGSTSalesAmount.Parameters.Append prm
And then a recordset is created with
Code:
cmdGSTSalesAmount.Parameters("Start").Value = StartDate
cmdGSTSalesAmount.Parameters("End").Value = EndDate
Set rsGSTAmount = cmdGSTSalesAmount.Execute
David Paulson