Results 1 to 2 of 2
  1. #1
    reddsable is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    1

    Access Syntax Error

    Hi all. What am I missing in this query? Access is telling me that I have a syntax error. It works in MySQL though. Thank you!

    delete t1, t2, t3, t4
    from (
    select u.product, count(*) counter


    from (
    select * from table1 union all
    select * from table2 union all
    select * from table3 union all
    select * from table4
    ) u
    group by u.product
    ) t
    left join table1 t1 on t1.product = t.product
    left join table2 t2 on t2.product = t.product
    left join table3 t3 on t3.product = t.product
    left join table4 t4 on t4.product = t.product
    where t.counter = 1;

  2. #2
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,033
    syntax wise I don't see an issue other than access tends to put brackets around joins.

    (((left join table1 t1 on t1.product = t.product)
    left join table2 t2 on t2.product = t.product)
    left join table3 t3 on t3.product = t.product)
    left join table4 t4 on t4.product = t.product

    What is the description of the error?

    Otherwise suggest build up and test starting from your U query until the error appears

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Ms access 2010 insert into syntax error
    By accessTenderfoot in forum Queries
    Replies: 13
    Last Post: 08-14-2015, 07:58 PM
  2. Syntax Error in my Access SQL Query
    By hellfire45 in forum Access
    Replies: 1
    Last Post: 03-10-2015, 01:40 PM
  3. Replies: 3
    Last Post: 01-29-2015, 07:48 PM
  4. Access 2007 syntax error in query
    By ivanver in forum Queries
    Replies: 3
    Last Post: 04-23-2011, 09:41 AM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums