I am trying to query through R OBDC. But one Column name has space on it. For example, [Account No]
.
I am using this code to query:
esiid_ac <- sqlQuery(myconn, paste("
SELECT * FROM CustomerUsage WHERE ((CustomerUsage.Account No ='", 12345, "')) ", sep=""),as.is=TRUE)
I am getting the following error:
[1] "42000 102 [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near 'No'." [2] "[RODBC] ERROR: Could not SQLExecDirect '\n SELECT * FROM CustomerUsage WHERE ((CustomerUsage.Account No ='678987')) '
How to solve this?
Can I read this table with column index instead of column names?
Thank you.