Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax Error: Comma in Query Expression of SQL Statement?

Tags:

sql

vba

ms-access

Alright folks, I am 100% Batshit insane at this point. Can someone possibly help me here? I'm clueless after trying EVERYTHING and searching for others with this experience. I'm at a loss here. I've tried brackets around all the table/field names. I've tried taking the tablename off the Select fields, I've tried moving the parenthesis backwards and forwards but to no avail.

The error I get is: "Syntax Error (comma) in query expression. '( [F1], [F2], [F3], [F4], [F5], [F6], [F7], [F8] )'.

    CurrentDb.Execute "INSERT INTO [tblSalesJournal] ( [Store], [Business Unit], [Country], [State], [Store Type], [Net Sales], [Fee], [Total] ) " & _
    "SELECT ( [F1], [F2], [F3], [F4], [F5], [F6], [F7], [F8] ) " & _
    "FROM [tblImport]"

Any help is GREATLY appreciated

like image 784
user2296381 Avatar asked Jan 12 '23 00:01

user2296381


1 Answers

The problem is:

SELECT ( [F1], [F2], [F3], [F4], [F5], [F6], [F7], [F8] )

You should not bracket a SELECT statement, therefore

SELECT [F1], [F2], [F3], [F4], [F5], [F6], [F7], [F8]

Some MS errors are odd.

like image 148
Fionnuala Avatar answered Jan 18 '23 17:01

Fionnuala