Share via

error message in access: syntax error in query

Anonymous
2021-10-18T16:32:33+00:00

I'm trying to do this query in access but I am getting this error "syntax error in query. incomplete query clause". Should I be rewriting it as a join statement instead?

select

'MAIN DATABASE'.CoupaREQ,  

'MAIN DATABASE'.OldServiceTag,  

'REQ Lookup'.'Old Tag Serial', 'REQ Lookup'.'Coupa Req',  

'REQ lookup'.'Req From Tracker' 

from

'MAIN DATABASE', 'REQ Lookup' 

where

'MAIN DATABASE'.ID = 'REQ Lookup'.ID ;
Microsoft 365 and Office | Access | For home | 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

Answer accepted by question author

  1. DBG 11,711 Reputation points Volunteer Moderator
    2021-10-18T16:56:27+00:00

    It may be your use of single quotes around the table names. Try using square brackets instead. For example:

    [MAIN DATABASE] and [REQ Lookup]

    Hope that helps...

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. DBG 11,711 Reputation points Volunteer Moderator
    2021-10-18T17:35:01+00:00

    Hi. Glad to hear you got it sorted out. It's highly recommended to avoid using spaces in table names to prevent unexpected problems like this. Good luck with your project.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2021-10-18T17:22:57+00:00

    Yes, very true... what I did was I went back in query, used designer and made a simple query to see how access laid the querys out, then moved on till i got what I wanted, I was able to see how access wanted it formatted. It was definitely a lot of the issue of needing brackets.

    Was this answer helpful?

    0 comments No comments
  4. Tom van Stiphout 40,201 Reputation points MVP Volunteer Moderator
    2021-10-18T16:58:09+00:00

    theDBGuy is right.

    One way to learn the SQL syntax is to first design a query in the Designer, then switch to SQL view. You will see the use of square brackets.

    Was this answer helpful?

    0 comments No comments