• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL column name with blank space

SONYFX

Senior member

I have a column name "City Name" in the table, however when I use the query:

"select * from table where City Name = 'NY'"

I get an error ([Microsoft][ODBC Excel Driver] Syntax error (missing operator) in query expression 'City Names = 'NY''. ), does anyone know how to fix this withput changing the column name?
 
Originally posted by: Snapster
Select * from table where [city name] = 'NY'

Thanks, but I still got an error, I think the SQL is thinking it needs two columns:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Excel Driver] Too few parameters. Expected 2.

 
Originally posted by: Drakkon
Select * from 'TableName' where 'TableName'.'City Name' = 'NY'

Still has error:

[Microsoft][ODBC Excel Driver] Syntax error in query. Incomplete query clause
 
its because excel doesn't use column names, it uses the headers like A,B,C,D,E,F to define columns. and thats the way you have to preform lookups when accessing an excel "table".
 
Originally posted by: Drakkon
its because excel doesn't use column names, it uses the headers like A,B,C,D,E,F to define columns. and thats the way you have to preform lookups when accessing an excel "table".

That's not exactly true. See the article posted above, especially the part about the HDR variable.
 
Back
Top