SQL string (1 Viewer)

Geoff Codd

Registered User.
Local time
Today, 00:44
Joined
Mar 6, 2002
Messages
190
Hi there,

I am having problems with the following SQL

sSQL = "INSERT INTO tblGrouped_RvS_Detail_Var_Crosstab ( reporting ) IN " & vDestination & _
"vReporting_Folder & 'AvE_' & vReporting_Entity & '.mdb' & _
"SELECT tblGrouped_RvS_Detail_Var_Crosstab.*, tblGrouped_RvS_Detail_Var_Crosstab.reporting & _
"FROM tblGrouped_RvS_Detail_Var_Crosstab & _
"WHERE (((tblGrouped_RvS_Detail_Var_Crosstab.reporting) Like vReporting_Entity& "*"));")

The offending line is highlighted, i get the error "Complie Error - Expected end of statement".

Any ideas, much appreciated.
Thanks in advance
Geoff
 

Mile-O

Back once again...
Local time
Today, 00:44
Joined
Dec 10, 2002
Messages
11,316
Look at your string delimiters on constructing the SQL. You have not put them at the end of the line.
 

Geoff Codd

Registered User.
Local time
Today, 00:44
Joined
Mar 6, 2002
Messages
190
Thanks for the help, Ilooked at some of you other posts and I finally got it working as

sSQL = "INSERT INTO tblGrouped_RvS_Detail_Var_Crosstab " & _
" IN """ & vFile & """ " & _
" SELECT tblGrouped_RvS_Detail_Var_Crosstab.* " & _
" FROM tblGrouped_RvS_Detail_Var_Crosstab " & _
" WHERE (((tblGrouped_RvS_Detail_Var_Crosstab.reporting) Like """ & vReporting_Entity & """ & '*'));"

Thanks
Geoff

PS. If there is any way I could improve the above, I'd love to know
 

Users who are viewing this thread

Top Bottom