nicks60610
MIS
I keep getting this error:
Error: -2147217900
Error Description: [Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
When I run this select statement in my VB code, I look at the spelling of the tables and they are identical to the code in Access qry, so that's not the issue, but am I missing something else??
Thanks in advance
cmdLookupMachines.CommandText = "SELECT [Production Data Table].[Date], [Production Data Table].[Shift], [Production Data Table].[Line], [Production Data Table].[Pieces], [Production Data Table].[Scrap], Sum(([Pieces]+Nz([Scrap])/2)) AS CycleCount" & _
"FROM [Production Data Table]" & _
"WHERE ([Production Data Table].Date) Between Date() And Date()-1) AND (([Production Data Table].Line)='1A')" & _
"GROUP BY [Production Data Table].[Date], [Production Data Table].[Shift], [Production Data Table].[Line], [Production Data Table].[Pieces], [Production Data Table].[Scrap]"
Error: -2147217900
Error Description: [Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
When I run this select statement in my VB code, I look at the spelling of the tables and they are identical to the code in Access qry, so that's not the issue, but am I missing something else??
Thanks in advance
cmdLookupMachines.CommandText = "SELECT [Production Data Table].[Date], [Production Data Table].[Shift], [Production Data Table].[Line], [Production Data Table].[Pieces], [Production Data Table].[Scrap], Sum(([Pieces]+Nz([Scrap])/2)) AS CycleCount" & _
"FROM [Production Data Table]" & _
"WHERE ([Production Data Table].Date) Between Date() And Date()-1) AND (([Production Data Table].Line)='1A')" & _
"GROUP BY [Production Data Table].[Date], [Production Data Table].[Shift], [Production Data Table].[Line], [Production Data Table].[Pieces], [Production Data Table].[Scrap]"