.CommandText = Array("select a.sdate,a.stockid,a.buy,a.sell,b.sdate,b.stockid,b.eq0,b.eq1 from dbo.CompTradeMonth a inner join dbo.StockStore b on a.stockid=b.stockid where a.sdate='2010-03-31 00:00:00.000' and b.sdate='2010-03-31 00:00:00.000' and a.stockid>1000")
.CommandText = Array("select a.sdate,a.stockid,a.eq0,a.eq1,a.eq5,a.eq10,a.eq15,a.eq20,a.eq30,a.eq50,a.eq100,a.eq200,a.eq400,a.eq600,a.eq800,a.eq1000,a.eq,b.sdate,b.stockid,b.Buy,b.Sell,b.UD,b.EQ from dbo.StockStore a inner join dbo.CompTradeMonth b on a.stockid=b.stockid where a.sdate='2010-03-31 00:00:00.000' and b.sdate='2010-03-31 00:00:00.000' and a.stockid>1100")
.Name = "來自 "
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub
複製代碼
作者: joey0415 時間: 2010-6-7 18:45
請問.CommandText = Array("select a.*,b.*,c.*,d.* from dbo.StockStore a left join dbo.StockMonth b on a.stockid=b.stockid left join dbo.CompTradeMonth c on a.stockid=c.stockid left join dbo.CreditExchangeMonth d on a.stockid=d.stockid where a.stockid>1100 and a.sdate='2010-03-31 00:00:00.000' and b.sdate='2010-03-31 00:00:00.000' and c.sdate='2010-03-31 00:00:00.000' and d.sdate='2010-03-31 00:00:00.000'")
陣列中的值是不是要相同型態的,不然怎會「執行階段錯誤13」,請問怎麼改成相同型態呢?