
Did you copy that from SQL View? Or from VBA? If it was from SQL View then that's your problem. There anything after the ; doesn't belong. If its from VBA, then then we need to see the results from the DEbug.Print in the Immediate window.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have Access from Microsoft 365, I am creating a query, and when I try to save it the error:
Characters found after end of SQL statement.
I have tried to find the error and can't run a debug because it hasn't been saved. How can I debug to find the error?
This SQL statement converts the signal-hour fields into universal UTC military time.
Please delete my post. I am taking another option. Thank you all for your help. I need more education in Access before taking on this type of project.
Thanks again, Jerry
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Did you copy that from SQL View? Or from VBA? If it was from SQL View then that's your problem. There anything after the ; doesn't belong. If its from VBA, then then we need to see the results from the DEbug.Print in the Immediate window.
Again, the more explanation and context available to us, the more likely it will be that someone can offer useful suggestions.
As Scott asked, where did you copy that text from? You mention a query, but that appears to be the SQL from a query along with a VBA procedure. What exactly, was the source of the components?
Thanks for the clarifications.
I can see no mention of the SELECT keyword in the GenerateMondayOnly procedure.
The following line is concatenated into the string expression twice
strSQL = strSQL & " INTO [Monday Only Converted] FROM [Monday Only];"
Note that the terminating semi-column is not necessary as you are executing the SQL statement in code.
I would question the table designs. By having multiple columns for the times, data is being encoded as column headings. A fundamental principle of the database relational model is the Information Principle (Codd's Rule #1). This requires that all data be stored as single values at column positions in rows in tables, and in no other way.
The structure can be corrected by decomposing the tables so that each time is stored in a single column in a referencing table, which is related to the referenced table on a foreign key which references the primary key of the referenced table. When inserting the time values into separate rows in the referencing table the basis for each time value can then be obtained with a join rather than an array.
I copied from the Access SQL view at the bottom right labeled SQL. I have no results from the debug, as I cannot save my SQL without getting an error message: The SELECT statement includes a reserved word or an argument name that is misspelled or missing the punctuation is incorrect
I was not able to save due to an error, so I copied and put it in a WORD Document. I copied the Word doc to post.
My original copy came from the SQL view in Access query.