0

Having trouble with a union statement. Front end is MS Access, back end is MySQL (MariaDB5)

The union query works fine when the tables are located within the database. Once I moved the tables to the MySQL database (accessed through MYODBC) I now recieve a #1064 Error at line 1. Here is the union;

SELECT ModelName, "Main Floor" AS Room, MainFlrTotalCarpet As SqFt FROM 
Dec_Models
UNION SELECT ModelName, "Bedrooms Only", BedroomsTotal FROM Dec_Models
UNION SELECT ModelName, "Second Floor Hall", SecondFlrHall FROM Dec_Models;
UNION SELECT ModelName, "Loft", Loft FROM Dec_Models;

Any help is greatly appreciated.

NewbieVBA
  • 47
  • 2
  • 7
  • Possible duplicate of [Multiple UNION query doesn't work](https://stackoverflow.com/questions/12804495/multiple-union-query-doesnt-work) (use `UNION ALL` instead of `UNION`) – Erik A Feb 14 '18 at 21:21
  • Thanks for the link. The info in that thread is way over my head unfortunately. – NewbieVBA Feb 16 '18 at 14:16

1 Answers1

0

You have a semi-colon at the end of the next to last line. That's your syntax error.

dbdemon
  • 207
  • 2
  • 10
  • Thanks, but that did not work. It appears the error is at line 1. I've been reading other posts but I'm afraid it's over my head in code. – NewbieVBA Feb 16 '18 at 14:16