求助 :数组相减从SQL读取完的数放在两个数组中,然后将这两个数组相减
求助 :数组相减从SQL读取完的数放在两个数组中,然后将这两个数组相减,两个数组行和列都相同 Sub Main()
Dim totelA As Integer
Dim b()
Dim c() As Variant
Dim d()
Dim e() As Variant
Dim f()
Dim ar As Variant, br As Variant
'ar = c
'br =e
Dim i As Integer
id& = SQLOpen("DSN=DATASEVR",,3)
sel="Select F1累重,F2累重 FROM dbo.View_1 Where ((DatePart(hh, dbo.View_1.timestamp)) = 0 And (DatePart(MI, dbo.View_1.timestamp)) = 0) "
qry& = SQLExecQuery(id&,SEL)
i% = SQLBind(id&,b,1)
i% = SQLBind(id&,b,2)
l& = SQLRetrieve(id&,c)
For x = 0 To (i% - 1)
MsgBox c(0,x)
Next x
sel="Select F1累重,F2累重 FROM dbo.View_1 Where ((DatePart(hh, dbo.View_1.timestamp)) = 8 And (DatePart(MI, dbo.View_1.timestamp)) = 0) "
qry& = SQLExecQuery(id&,SEL)
i% = SQLBind(id&,d,1)
i% = SQLBind(id&,d,2)
l& = SQLRetrieve(id&,e)
For x = 0 To (i% - 1)
MsgBox e(0,x)
Next x
f(0,0) = Evaluate("{" & Join(e, ",") & "}-{" & Join(c, ",") & "}")
'For x = 0 To (i% - 1)
'f(0,0)=cint(e(0,0))-cint(c(0,0))
' Next x
sel="INSERT INTO Table_1 VALUES("+f(0,0)+","+f(0,1)+")"
qry& = SQLExecQuery(id&,SEL)
End Sub