tags:

views:

67

answers:

3
SELECT * FROM [makes$] WHERE "Corporate Name"='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.

+2  A: 

total guess here but its probably

SELECT * FROM [makes$] WHERE [Corporate Name]="Champion Enterprises, Inc."
Conrad Frix
+1 for the first right answer, but please remove the total guess part
Lance Roberts
Is a double-quote delimited string value really correct?
jball
+1  A: 

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

SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'
jball
That fixed it thank you
brettville
Glad to help! :)
jball
+2  A: 
SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'
Detect