BennyLinton
Registered User.
- Local time
- Today, 07:00
- Joined
- Feb 21, 2014
- Messages
- 263
I am trying to pass the results of a query into a ADO recordset. This VBA code executes fine but does not yield the same results as a standalone query. How can I recode this so "Set rs1 = results of query..."? I know how to write the standalone query but not how to make it the recoset... thanks!
Here is the current VBA:
Set rs1 = con.Execute("Select c.peopleID, c.certificationID, c.certificationExpireDate, p.useCredits, Datepart(M,c.certificationExpireDate) From People p " & _
"INNER JOIN certs c ON p.peopleID = c.peopleID Where c.statusID = 1 and " & _
"Datepart(M,c.certificationExpireDate) = " & bmonth & " " & _
"Order by c.peopleID")
Here is the current VBA:
Set rs1 = con.Execute("Select c.peopleID, c.certificationID, c.certificationExpireDate, p.useCredits, Datepart(M,c.certificationExpireDate) From People p " & _
"INNER JOIN certs c ON p.peopleID = c.peopleID Where c.statusID = 1 and " & _
"Datepart(M,c.certificationExpireDate) = " & bmonth & " " & _
"Order by c.peopleID")