I have Access from Microsoft 365 and havinga query problem

Anonymous
2025-05-25T01:04:49+00:00

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

Microsoft 365 and Office | Access | Other | Windows

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.

0 comments No comments
{count} votes

22 answers

Sort by: Most helpful
  1. ScottGem 68,755 Reputation points Volunteer Moderator
    2025-05-25T11:33:10+00:00

    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.

    0 comments No comments
  2. George Hepworth 21,805 Reputation points Volunteer Moderator
    2025-05-25T12:00:12+00:00

    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.

    0 comments No comments
  3. Anonymous
    2025-05-25T12:41:45+00:00

    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.

    0 comments No comments
  4. Anonymous
    2025-05-25T19:15:41+00:00

    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

    0 comments No comments
  5. Anonymous
    2025-05-25T19:18:30+00:00

    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.

    0 comments No comments