Syntax error???

  • Hello all, I am a little new to SQL, and when trying to run the following statement, I get the error:


    "Microsoft JET Database Engine error '80040e14'

    Syntax error (missing operator) in query expression 'Counter IN ()'.

    /Pm/Pmgen2.asp, line 448


    Here is the statement:

    sSQL = "INSERT INTO WOLabour (Employee,TransDate,WoNum,LaborType,Scale,Hours,Rate,Tax1,Tax2,AddCost,TotalCost,Account,Description,ModifyDate,Estimate,RefNum,Craft,ChargeBackAmount,TaskNum) " & _          "SELECT Employee,'" & txdate & "',WoNum,LaborType,Scale,Hours,Rate,Tax1,Tax2,AddCost,TotalCost,Account,Description,'" & curDate & "',0,Counter,Craft,ChargeBackAmount,TaskNum FROM WOLabour WHERE Counter IN (" & counters & ")"   conn.Execute sSQL, , 128

    Any help would be greatly appreciated.

    Thanks,

    Parallon

  • you variable counters is null. Make sure it has a value

     


    Kindest Regards,

    Amit Lohia

  • and if the counters is a sql variable then you refer to them as @counters (for local variable)

    \


    Kindest Regards,

    Amit Lohia

  • Your error message refers to "Microsoft JET Database Engine". JET is normally Microsoft Access.

    This site, while it does have a forum for Access, is for Microsoft's SQL Server. SQL Server uses a different form of SQL called Transact-SQL (Access uses Jet-SQL).

    If you are using Access, you should post in an Access forum.

    -SQLBill

  • Found out that it was my session was timing out.  This, I guess, refers back to Amit's response about it being null.

    Thanks,

    Parallon

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply