473,662 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Syntax error missing operator in query expression

4 New Member
This error plagues my SQL and as the error is so generic and comprises multiple lines, I have nothing to search on.

I can correct it only to have an "Syntax error in UPDATE statement."

So, sample
Error begins at TRUE and ends before the WHERE.
Expand|Select|Wrap|Line Numbers
  1. UPDATE [Inspections SHELL]
  2. SET  [Inspections SHELL].[Phase 1] = TRUE -- Toggle Yes/No on
  3. INNER JOIN [Inspections Attempt]
  4. ON ([Inspections SHELL].[Field] = [Inspections Attempt].[Field]) 
  5. AND ([Inspections SHELL].[start] = [Inspections Attempt].[date])
  6. WHERE ([Inspections Attempt].[Phase] = 1);
  7.  

This is a reduction of the following code

Expand|Select|Wrap|Line Numbers
  1. UPDATE [Inspections SHELL]
  2. SET  [Inspections SHELL].[Phase 1] = IIf([Inspections Attempt]![Phase]=1,True,False), --Toggle Phase 1 if Phase = 1
  3.      [Inspections SHELL].[Phase 2] = IIf([Inspections Attempt]![Phase]=2,True,False), --Toggle Phase 2 if Phase = 2
  4.      [Inspections SHELL].[18X Day] = IIf([Inspections Attempt]![Phase]=0,True,False), --Toggle 180 day if Phase = 0
  5.     /* Toggle appropriate state if note indicates */
  6.      [Inspections Shell].[Acceptence] = IIF(instr([Inspections Shell].[Notes], "Accept") > 0, true, false),
  7.      [Inspections Shell].[Special] = IIF(instr([Inspections Shell].[Notes], "Spec") > 0, true, false),    
  8.      [Inspections Shell].[CC] = IIF(instr([Inspections Shell].[Notes], "CC") > 0, true, false)    ,
  9.      [Inspections Shell].[90 Day] = IIF(instr([Inspections Shell].[Notes], "90") > 0, true, false),
  10.      [Inspections Shell].[1 Year] = IIF(instr([Inspections Shell].[Notes], "1 year") > 0, true, false),        
  11.      [Inspections Shell].[2 Year] = IIF(instr([Inspections Shell].[Notes], "2 year") > 0, true, false),    
  12.      [Inspections Shell].[W&B] = IIF(instr([Inspections Shell].[Notes], "&") > 0, true, false)    
  13. FROM [Inspection SHELL] 
  14. INNER JOIN [Inspections Attempt]
  15. ON ([Inspections SHELL].[Field] = [Inspections Attempt].[Field]) 
  16. AND ([Inspections SHELL].[start] = [Inspections Attempt].[date]);
  17.  
  18. Which has the same series of errors.
  19.  
As a supplement, most update queries that I get to "work" will explode my database (going from 7 MB to 200 MB with a creation of 20,000+ null records). The only update that has worked has used bare minimum syntax, so the actual question may be "what am I missing with update syntax?"
Mar 15 '11 #1
4 2690
ADezii
8,834 Recognized Expert Expert
Try a change in Syntax, specifically the location of the SET Statement, as in:
Expand|Select|Wrap|Line Numbers
  1. UPDATE [Inspections SHELL]
  2. INNER JOIN [Inspections Attempt]
  3. ON ([Inspections SHELL].[Field] = [Inspections Attempt].[Field])
  4. AND ([Inspections SHELL].[start] = [Inspections Attempt].[date])
  5. SET [Inspections SHELL].[Phase 1] = True
  6. WHERE [Inspections Attempt].[Phase] = 1;
Mar 15 '11 #2
Jeff Miller
4 New Member
That gets rid of the syntax problem... now to test it; but hat is supremely annoying, I found the relocation of the join in a forum but I got an error in UPDATE.

Will this method work for the mass update?

EDIT:

It doesn't join properly.

Each table has identical fields being inner joined, but I'm only getting 65 records returned of 312, and none of them have [Phase 1] = True.
Mar 15 '11 #3
ADezii
8,834 Recognized Expert Expert
@Jeff - Can you Upload a Copy of the Database with a Minimal number of Records, stripped of any Personal Info, of course? This way, we can see the problem first hand.
Mar 15 '11 #4
Jeff Miller
4 New Member
I'll see what I can do.

Going to have to use an update query to scramble some of the data to enforce privacy.

Expand|Select|Wrap|Line Numbers
  1. UPDATE table
  2. SET table.Field = Right([table]![Field],1) & Mid([table]![Field],2,2) & Left([table![Field], 3);
  3.  
Should change all records such that ABCD would become DBCABC right? Because it's not doing -anything-, and I cannot submit it with the current fields as is, and they have to be all updated in the same format to preserve data relationship.
Mar 15 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3081
by: alexz | last post by:
valuA = (request.form("toadd")) If valuA = "" then SQL = "UPDATE CourseReg SET attended='Active' WHERE ID IN("&request.form("toadd")&")" Set RS = MyConn.Execute(SQL) End If MyConn.Close Set RS = Nothing Set MyConn = Nothing
29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
4
18044
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out on me for some reason. The Summary field is pulled from a Rich Text Editor that allows HTML formatting and appears to be the culprit, but I just can't seem to figure out why. Any guidance is greatly appreciated. I'm connecting to an Access...
3
5525
by: Lumpierbritches | last post by:
Syntax Error (missing operator) in query expression =BLANK'S MOLLIE-PRINCE BRUISER-3/14/2004-03 AnimalID is correct. I'm trying to open with a command button or double click the frmAnimal from a subform that uses the same table, is that my problem? If I remove the criteria from the expression, it opens the form, but to show every record.
4
18217
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
1
4642
by: Justin R | last post by:
Hey I am really stuck and can't figure out what is wrong here is the code line and surrounding code, if anyone can help i would appreciate it. Thanks This first line is the line that has a problem and the following after the big gap is the whole thing. MySet.FindFirst Criteria ' Locate first occurrence. Option Compare Database 'Use database order for string comparisons Private Sub Form_BeforeUpdate(Cancel As Integer) ' Me!...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.