|
Dim dbs As Database
Dim rsn As Recordset
Dim kaohe As Date
Set dbs = CurrentDb
Set rsn = dbs.OpenRecordset("select * from 待匹配数据未匹配数据最终结果表")
kaohe = Combo67.Column(1)
'判断表中是否有记录,如果有记录,将被删除
If rsn.RecordCount > 0 Then
dbs.Execute "delete * from 待匹配数据未匹配数据最终结果表 where kaohe_term=# " & kaohe & " #"
End If
dbs.Execute "insert into 待匹配数据未匹配数据最终结果表 ( contract_number, sale_department, nation, operation, mainproduct_sort, revenue_first, cost_first, kaohe_term, contract_number_equipment ) " & _ "select distinct contract_number,sale_department,nation,operation,product_sort,期初收入,期初成本,kaohe_term,contract_number_equipment from 待匹配数据整理表按合同号加总 where kaohe_term=# " & kaohe & " #"
问题,运行上述语句后的数据表里插入的数据并没有对数据按kaohe_term=# " & kaohe & " #条件进行处理,请帮忙看一下是什么原因?谢谢!
[ 本帖最后由 dreamice01 于 2008-2-28 09:38 编辑 ] |
|