首页 > 解决方案 > 使用 SQL 将数据插入 Excel 文件

问题描述

我使用 SQL 语句在 excel 中插入一些日期。但有错误。

我试过了

INSERT INTO  Sheet1$ (Contribution Month, Serial, Name, Contributions Type, Amount, Status) 
VALUES (01/09/2018, 353660, BRUIN NOEL, Employer, -694.58, open)

INSERT INTO  Sheet1 (Contribution Month, Serial, Name, Contributions Type, Amount, Status) 
VALUES (01/09/2018, 353660, BRUIN NOEL, Employer, -694.58, open)

INSERT INTO  Sheet1$ (Contribution Month, Serial, Name, Contributions Type, Amount, Status) 
VALUES ('01/09/2018', '353660', 'BRUIN NOEL', 'Employer', '-694.58', 'open')

INSERT INTO  Sheet1 (Contribution Month, Serial, Name, Contributions Type, Amount, Status) 
VALUES ('01/09/2018', '353660', 'BRUIN NOEL', 'Employer', '-694.58', 'open')

有什么更正吗?

标签: sqlvba

解决方案


试试下面的代码:

INSERT INTO  [Sheet1$] ([Contribution Month], [Serial], [Name], [Contributions Type], [Amount], [Status]) 
VALUES ('01/09/2018', 353660, 'BRUIN NOEL', 'Employer', -694.58, 'open')

缺少一些字符。对于工作表名称[]、字段名称[]及其''字符串值。


推荐阅读