473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Syntax error (missing operator) in query expression

"I keep getting the following error when I try to modify a query: Syntax error (missing operator) in query expression 'ADPINTER.'. when this happens the qyuery can no longer be seen in design view it changes to SQL view and I can't get it back to design view. the following is the sql view:
Expand|Select|Wrap|Line Numbers
  1. SELECT ADPINTER.JOB_NUMBER, ADPINTER.EMPNO, ADPINTER.[EMPLOYEE NAME], [reg_hrs]+[ovr_hrs]+[other_hours] AS hours, EMPMAST.RATE1AMT, [hours]*[rate1amt] AS payrollold, EMPMAST.WORKERSCOMPCODE, ADPINTER.ENDPERIOD, 1 AS [COUNT], ADPINTER.UNION , IIf([payrollold]>750,750,[payrollold]) AS Payroll, ADPINTER.[total pay], ADPINTER.category, [Reg_grs]+[ovr_grs]+[Other Gross] AS gross INTO OCIP FROM EMPMAST INNER JOIN ADPINTER ON (ADPINTER.COMPANY=EMPMAST.[CO CODE]) AND (EMPMAST.EMPNO=ADPINTER.EMPNO) AND (EMPMAST.EMPNO=ADPINTER.EMPNO) WHERE (((ADPINTER.JOB_NUMBER) Between forms!autoload![From Job] And forms!autoload![To Job]) And ((ADPINTER.ENDPERIOD) Between forms!autoload!STARTDATE And forms!autoload!ENDINGDATE) And ((ADPINTER.category)"GC") And ((ADPINTER!EMPNO)909674 And (ADPINTER!EMPNO)909738 And (ADPINTER!EMPNO)902696 And (ADPINTER!EMPNO)6810 And (ADPINTER!EMPNO)7447 And (ADPINTER!EMPNO)902589 And (ADPINTER!EMPNO)909609 And (ADPINTER!EMPNO)939635 And (ADPINTER!EMPNO)909640 And (ADPINTER!EMPNO)909659 And (ADPINTER!EMPNO)909671 And (ADPINTER!EMPNO)909690 And (ADPINTER!EMPNO)909708 And (ADPINTER!EMPNO)909714 And (ADPINTER!EMPNO)909749 And (ADPINTER!EMPNO)909758 And (ADPINTER!EMPNO)909759 And (ADPINTER!EMPNO)909762 And (ADPINTER!EMPNO)909594)); 
Any assistance would be appreciated. Thanks Lou"
Jul 4 '08 #1
5 2124
RuralGuy
375 Expert 256MB
The design view can not display a UNION query.
Jul 4 '08 #2
MikeTheBike
639 Expert 512MB
The design view can not display a UNION query.
Hi

As RuralGuy said, Union Queries can only be displayed in SQL view, not in query designer.

However, this does not seem to be a UNION query.

I assume it fails at ‘ADPINTER.UNION’.

If so then it is likely the keyword UNION field name is triggering this (ie it THINKS it’s a union query).

I suggest this should cure the problem (but can’t guarantee it)

ADPINTER.[UNION]

On this basis, if it works, you will need to put [] round all instances of the field name UNION !!

If it doesn't work, then you will need to change your field name, which is probable the best solution any way !?

HTH

MTB
Jul 7 '08 #3
Hi

As RuralGuy said, Union Queries can only be displayed in SQL view, not in query designer.

However, this does not seem to be a UNION query.

I assume it fails at ‘ADPINTER.UNION’.

If so then it is likely the keyword UNION field name is triggering this (ie it THINKS it’s a union query).

I suggest this should cure the problem (but can’t guarantee it)

ADPINTER.[UNION]

On this basis, if it works, you will need to put [] round all instances of the field name UNION !!

If it doesn't work, then you will need to change your field name, which is probable the best solution any way !?

HTH

MTB

Thank you. Adding the brackets around UNION did fix my problem and I was able to get the query back in Design mode.
Jul 24 '08 #4
As I mentioned before thank you very much for your help. I would like to ask another question which maybe you can assist me with. The question is as follows:

What I am trying to do is create a query in Access that will help in my Worker's Comp reporting. I already have queries set up but I am missing one component. I have a query that states IF payrollold is greater than 750 THEN 750 IF not THEN payrollold. However I need to add a twist in that I need to add a statement which would give me the following result: IF hours is greater then 80 THEN 1500 (in the payroll column) IF not then 750.

I am having trouble mixing the hours part with the payroll part. Below is the SQL view of the query I need to modify.

SELECT ADPINTER.JOB_NUMBER, ADPINTER.EMPNO, ADPINTER.[EMPLOYEE NAME], [reg_hrs]+[ovr_hrs]+[other_hours] AS hours, EMPMAST.RATE1AMT, [hours]*[rate1amt] AS payrollold, EMPMAST.WORKERSCOMPCODE, ADPINTER.ENDPERIOD, 1 AS [COUNT], ADPINTER.[UNION], IIf([payrollold]>750,750,[payrollold]) AS Payroll, ADPINTER.[total pay], ADPINTER.category, [Reg_grs]+[ovr_grs]+[Other Gross] AS gross
FROM EMPMAST INNER JOIN ADPINTER ON (EMPMAST.[CO CODE] = ADPINTER.COMPANY) AND (EMPMAST.EMPNO = ADPINTER.EMPNO) AND (EMPMAST.EMPNO = ADPINTER.EMPNO)
WHERE (((ADPINTER.JOB_NUMBER) Between [forms]![autoload]![From Job] And [forms]![autoload]![To Job]) AND ((ADPINTER.ENDPERIOD) Between [forms]![autoload]![STARTDATE] And [forms]![autoload]![ENDINGDATE]) AND ((ADPINTER.category)<>"GC")

Any help would be greatly appreciated. Thanks Lou
Jul 24 '08 #5
MikeTheBike
639 Expert 512MB
As I mentioned before thank you very much for your help. I would like to ask another question which maybe you can assist me with. The question is as follows:

What I am trying to do is create a query in Access that will help in my Worker's Comp reporting. I already have queries set up but I am missing one component. I have a query that states IF payrollold is greater than 750 THEN 750 IF not THEN payrollold. However I need to add a twist in that I need to add a statement which would give me the following result: IF hours is greater then 80 THEN 1500 (in the payroll column) IF not then 750.

I am having trouble mixing the hours part with the payroll part. Below is the SQL view of the query I need to modify.

SELECT ADPINTER.JOB_NUMBER, ADPINTER.EMPNO, ADPINTER.[EMPLOYEE NAME], [reg_hrs]+[ovr_hrs]+[other_hours] AS hours, EMPMAST.RATE1AMT, [hours]*[rate1amt] AS payrollold, EMPMAST.WORKERSCOMPCODE, ADPINTER.ENDPERIOD, 1 AS [COUNT], ADPINTER.[UNION], IIf([payrollold]>750,750,[payrollold]) AS Payroll, ADPINTER.[total pay], ADPINTER.category, [Reg_grs]+[ovr_grs]+[Other Gross] AS gross
FROM EMPMAST INNER JOIN ADPINTER ON (EMPMAST.[CO CODE] = ADPINTER.COMPANY) AND (EMPMAST.EMPNO = ADPINTER.EMPNO) AND (EMPMAST.EMPNO = ADPINTER.EMPNO)
WHERE (((ADPINTER.JOB_NUMBER) Between [forms]![autoload]![From Job] And [forms]![autoload]![To Job]) AND ((ADPINTER.ENDPERIOD) Between [forms]![autoload]![STARTDATE] And [forms]![autoload]![ENDINGDATE]) AND ((ADPINTER.category)<>"GC")

Any help would be greatly appreciated. Thanks Lou
Hi

Glad you fixed the first problem.

You should start a new thread for a different problem, however, as I am here,I think you need a nested IIF ie

Change this

IIF([payrollold]>750,750,[payrollold]) AS Payroll

to this

IIF([payrollold]>750,IIF([reg_hrs]+[ovr_hrs]+[other_hours]>80,150,750),[payrollold]) AS Payroll


??

You explanation/logic of the required result(s) is not very explict, but I am sure you can work out what is requied for the desired resulty if the above is incorrect.


MTB
Jul 25 '08 #6

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

Similar topics

29
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"...
4
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...
3
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...
4
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double...
4
by: T. Wintershoven | last post by:
Hi Can someone please tell me whats wrong with the last line of the query below. The first three lines work fine but when i add the fourth line i get an error message (see text at ERROR...
7
by: John Øllgård Jensen | last post by:
Hi Using MS Asccess 2000: In a query I'm trying to create a new field with following expression: FilmDate: Left(,4) The field "FilmNo" is another text field in the query. This is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.