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!

(missing operator) in query

Status
Not open for further replies.

JKingdom

Programmer
May 9, 2004
141
AE
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'dept_id='.


am getting this strange error and i have no idea why !! .. i found out that teh code is perfect and no errors in it .. coz the problem gets solved when i replace the old database ( backup) .. although teh tables have the same design !!!!!!! and the fields has the same properties !! .. i have no idea whats the problem could be .. i can't use the old database coz i need the updated recoreds !!
 
solved .. one of the records in the database has no dept_id !! .. don't know how this could happened !! .. thanks anyways :)
 
When debugging SQL problems like this I find it helpful to use Response.Write to display the SQL that is actually being executed. Quite often I find the problem is easier to find when the syntax is visible.
 
If you have a problem with a field somtimes containing nulls, use this:

dept_id & "" = whatever

Concatenating the field value with an empty string seems to prevent the problem.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top