"select distinct month([table].日期) from [table]"作者: mhl9mhl9 時間: 2013-8-11 02:20
[attach]15745[/attach]
test1可以把整個資料庫copy到activesheet.A1
test2就出現上面的錯誤對話框
什麽地方寫錯了?
Sub test1()
ActiveSheet.Cells.ClearContents
Set iR = Range("A1")
iPath = ThisWorkbook.fullname
iQ = "select * from [資料庫$]"
iSql
End Sub
Sub test2()
ActiveSheet.Cells.ClearContents
Set iR = Range("A1")
iPath = ThisWorkbook.Path
iQ = "select month(資料庫.日期) from [資料庫$]"
iSql
End Sub作者: mhl9mhl9 時間: 2013-8-11 02:54
Sub test5()
ActiveSheet.Cells.ClearContents
Set iR = Range("A1")
iPath = ThisWorkbook.FullName
iQ = "select distinct Month(日期) as 月份 from [資料庫$]"
iSql
end sub作者: mhl9mhl9 時間: 2013-8-11 03:31