|
EXCEL我不懂,假设是ACCESS中的12张表吧
for i=1 to 12
docmd.runSql("update BOOK" & i & " set y=字段1*" & iif(cStr(12-i)<1,12,cStr(12-i)) & " + 字段2*" & iif(cStr(24-i)<12,24,cStr(24-i)) & " +字段3*" & iif(cStr(36-i)<24,36,cStr(36-i)) & " +字段4*" & iif(cStr(48-i)<36,48,cStr(48-i)) and x=字段1+字段2+字段3+字段4)
next
i=0
set rs=currentproject.connection.execute("select sum(x) as SumOfX, sum(Y) as SumOfY,id from (select x,y,id from book1 union all select x,y,id from book2.....union all select x,y,id from book12) group by id")
rs.filter=rs("SumOfX=150 and SumOfY=3880")
这时rs里面就是同一个ID里X的值和Y的值分别为150和3880的了.
怎么个填法,看不懂你写的内容,自己写吧.
以上未做调试,只是想想的,如有错误,还请原谅
|
|