I am using VB.net (2010) for database management with a MSAccess 2003 database on Windows10. For deletion of a record I using sql query:
query = "DELETE * FROM monthOverAll WHERE actDate =" + catchDate + "AND doneBy =" + catchDoneBy + "AND (Training > 0) OR (EA > 0) OR (OFT > 0) OR (FLD > 0) OR (splEvent > 0) OR (farmProd > 0) OR (CovidActivity > 0) OR (CFLD > 0))"
monthOverAll is the table
actDate, doneBy, Training, EA, OFT, FLD, splEvent, farmProd, CovidActivity, CFLD are database fields.
catchDate, catchDoneBy are variables.
while executing it I get the following error. Can anyone please help me with this. Thanks in advance.
Syntax error (missing operator) in query expression 'actDate =03-Aug-21AND doneBy =DR GPM SINGHAND (Training > 0) OR (EA > 0) OR (OFT > 0) OR (FLD > 0) OR (splEvent > 0) OR (farmProd > 0) OR (CovidActivity > 0) OR (CFLD > 0))'.
What I have tried:
I have tried all sorts combinations but nothing seems to work.