unknow column

Harry_38

Registered User.
Local time
Tomorrow, 00:14
Joined
Jan 14, 2011
Messages
47
Got a column: Season-id
If I make a pass through-query, I get an error: Unknown Column.
Is there a simple solution, else I will have to change the name of the column into e.g. SeasonId (but it has an impact on many forms and reports, would hate to that)
Pls help.
 
Because you used a dash (which signifies subtraction) make sure you include square brackets around the name.

[Season-id]
 
I tried the square brackets [season-id]; doen't solve my problem.
pls help
 
Thanks Bob,
Mind you I am new in Mysql; this was the very first pass through-query.
MySQL query: SELECT [Seizoen-id], BankboekID, Datum, OntvangenE, BetaaldE from Bankboek
I entered the query directly on the website, it doesn't work there either; i get the error message:
MySQL retourneerde: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[Seizoen-id], BankboekID, Datum, OntvangenE, BetaaldE from Bankboek
LIMIT 0, 30' at line 1
 
I'm not a MySQL user so I may not be the best resource. Can you try this and see if it works?

SELECT [Seizoen-id], [BankboekID], [Datum], [OntvangenE], [BetaaldE] FROM Bankboek;
 
Bob, SQL doesn't accept square brackets.
SELECT (BankboekID), (Datum), (OntvangenE), (BetaaldE) FROM Bankboek; ----- works ok
But not: (seizoen-id)
What to do?
 
What are the fields in table Bankboek?
 
Fields in the table Bankboek are (in Dutch):
Seizoen-id, BankboekID, Datum, OntvangenE, BetaaldE
 
Since you seem to be selecting them all, can you not use

Select * FROM Bankboek

instead?

Sorry, I forgot you can't do that with a pass through query. :(
 
Last edited:
I found it: Use ' around Seizoen-id
SELECT BankboekID, Datum, 'Seizoen-id', OntvangenE, BetaaldE from Bankboek
It works, thanks for the help
 
Just to be sure, you should use backtick character ( ` ) and not single quote character ( ' ) as an object identifier for MySQL. If that's what was actually used, then I'm glad you solved this.

BTW, another alternative: you can set sql_mode to allow ANSI and therefore allow you to use the quote character ( " ) as an identifier. This can be set for the session and thus can be specific to Access only at the startup.
 

Users who are viewing this thread

Back
Top Bottom