我希望在 VBA 上运行 SQL 查询,该查询将从 MS Access 返回信息到单元格 A1。
目前,我正在运行 SQL 查询,SELECT AccountNumber, BorrowerName from AccountTable;它只返回 A 列中的帐号 - 它不返回 BorrowerName。同样,如果我要运行SELECT * from AccountTable;,它将只返回 AccountNumber 列。有任何想法吗?
(忽略直到Dim conn As New Connection)
'runs an sql query
Sub RunQueryOnAccess()
'Declaring year value of 1 month & 2 month
'This is important to compare datasets from 2 months ago & last month
Year_1M = Format(Date - 27, "YYYY")
'Declaring month value of 1 month & 2 month …Run Code Online (Sandbox Code Playgroud)