Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Syntax error???

Author  Topic 

parallon
Starting Member

25 Posts

Posted - 2006-03-08 : 19:02:38
Hello all, I am a little new to SQL, and when trying to run the following statement, I get the error:

quote:
"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

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-03-08 : 22:15:27
check the resulting sSQL string...

if you want, post it here...

remember that IN will look for constants/values separated by comma

HTH

--------------------
keeping it simple...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-09 : 01:09:40
Post the message that msgbox sSQL displays

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -