开发者

What's wrong with my SQL statement?

开发者 https://www.devze.com 2023-01-19 11:40 出处:网络
SELECT * FROM [makes$] WHERE \"Corporate 开发者_如何学PythonName\"=\'Champion Enterprises, Inc.\'
SELECT * FROM [makes$] WHERE "Corporate 开发者_如何学PythonName"='Champion Enterprises, Inc.'

I'm running this query on an XLS excel file using ADO in VBA. There are about 10-20 records containing this corporate name but it returns EOF.

I'm fairly new to database but I'm certain everything is correct aside from my SQL statement.

If I SELECT * FROM [makes$], it returns all the records successfully.


SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'


total guess here but its probably

SELECT * FROM [makes$] WHERE [Corporate Name]="Champion Enterprises, Inc."


Use [] instead of "" for column names with spaces in them:

SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'
0

精彩评论

暂无评论...
验证码 换一张
取 消