我试图从表data
中检索A列(单元格A1到A20000)中的数据。当我提出此查询时,我收到错误:"意外的额外令牌Dim
"。我做错了什么?
SELECT
OZATI_etc.Account,
OZATI_etc.Equipment
FROM
OZATI_etc
WHERE
OZATI_etc.Account IN (SELECT * FROM [data$A1:A20000])
ORDER BY
OZATI_etc.Account
Dim currentRow As Integer
Dim str As String
currentRow = 1
Do While (sheets("data").Range("A" & currentRow).Value <> "")
str = str & ",'" & sheets("data").Range("A" & currentRow).Value & "'"
currentRow = currentRow + 1
Loop
str = Mid(str, 2)