Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

oled Error message

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
I have been using this delete query for many months in a vb.net program and it has run perfectly, but as of yesterday when it is run the following message appears. Basically the delete query looks for duplicates and only deletes duplicates and keeps the first entry of that duplicate.

First below is the delete query...
sSQL = "DELETE [Lab Table].TDate, [Lab Table].ID, [Lab Table].Qty, * FROM [Lab Table] WHERE ((([Lab Table].TDate) " & _
" Between Date()-10 And Date()) AND (([Lab Table].ID) Not In (SELECT Min(ID) as MinID FROM [Lab Table] " & _
"WHERE ([Lab Table].TDate Between Date()-10 And Date()) GROUP BY [Lab Table].LotNumber)) AND (([Lab Table].Qty)=[Lab Table].[Qty]));"


ERROR MESSAGE....
System.Data.OleDb.OleDbException.Synteax error (missing operator) in query expression " (LBL 'S I')'.
at system.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorhandling(Int32hr)
at System.Dat.OleDb.OleDbCommand.ExecuteCommandTextforSingleResult(tagDBPARAMS dbParams, Objects& executeResult)
at system.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at system.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavoir, ObjectsResult)
at system.Data.OleDb.OleDbCommand.ExecuteReaderInternal(COmmandbehavior, String method)
at system.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at MAX_Data_Interace.From1.btnloadAccess_Click(Object sender, EventArgs e)............................

Where should I look to correct this? For the query to duplicate will not run now. Thanks



 
Have you got single quotes in any of your fields?
 
The delete query has been running just fine. I don't see any single quotes in that query at all. The delete query is listed above. I will look in other fields too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top