user2296381
user2296381

Reputation: 197

Syntax Error: Comma in Query Expression of SQL Statement?

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

Upvotes: 4

Views: 11235

Answers (1)

Fionnuala
Fionnuala

Reputation: 91356

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.

Upvotes: 9

Related Questions