|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
使用ADO对象,OPEN你的access;
execute这个SQL试试:
-
- SQL = "INSERT INTO 订单汇总表(采购编号,采购单号,下单日期,设备号,项目名称,图号代号,产品名称,规格型号,单位,单价,长度,数量,金额,供应商," & _
- "到货地,发票号,开票时间,付款金额,付款日期,付款申请单号,要求到货日期,实际入库日期,入库单号,摘要备注,送货详细地址) "
- SQL = SQL & "SELECT 采购编号,采购单号," & _
- "CDATE(下单日期) AS 下单日期," & _
- "设备号,项目名称,图号代号,产品名称,规格型号,单位," & _
- "单价,长度,数量,金额," & _
- "供应商," & _
- "到货地," & _
- "发票号," & _
- "CDATE(开票时间) AS 开票时间," & _
- "付款金额," & _
- "CDATE(付款日期) AS 付款日期," & _
- "付款申请单号," & _
- "CDATE(要求到货日期) AS 要求到货日期," & _
- "CDATE(实际入库日期) AS 实际入库日期," & _
- "入库单号," & _
- "摘要备注,送货详细地址 " & _
- "FROM [EXCEL 12.0;DataBase=" & ThisWorkbook.FullName & ";].[订单汇总查询$B7:Z]" & _
- "WHERE 采购编号<>''"
复制代码
风险描述:
由于您始终没有提供具体的access文件,也没有给出真实的数据,所以,以下代码虽然测试通过了,但使用过程中或将存在各种问题,请知悉!
|
|