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!

Syntax error- can't find it, need a 2nd pair of eyes 1

Status
Not open for further replies.

MrsMope

Technical User
Oct 18, 2004
125
US
Hi All,
I am getting a syntax error:
[blue] Syntax error (missing operator) in query expression 'B.WB_NewRenew'. [/blue] in the following and I can't figure out what is wrong a 2nd pair of eyes would be greatly appreciated.
Code:
SELECT A.CUSTNMBR, 
A.CUSTNAME, 
B.SLPRSNID,
 C.SPRSNSLN,
 Sum(B.WB_COMM_CALC) AS SumOfWB_COMM_CALC, 
B.WB_DATE_COMM_PROC, 
B.WB_NEWRENEW, 
B.WB_COMM_ID, 
1 AS Company, 
B.WB_TIER_PERC, 
B.ITEMNMBR FROM 
(WaubeWB_CPICH as B LEFT JOIN WaubeRM00101 as A ON B.CUSTNMBR = A.CUSTNMBR) 
LEFT JOIN WaubeRM00301 as C ON B.SLPRSNID = C.SLPRSNID 
WHERE WB_DATE_COMM_PROC <= # 11/30/2005 # and  WB_DATE_COMM_PROC >= # 11/30/2004 # 
and SLPRSNID = '109757         '

UNION ALL 
SELECT A.CUSTNMBR, 
A.CUSTNAME, 
B.SLPRSNID, 
C.SPRSNSLN, 
Sum(B.WB_COMM_CALC) AS SumOfWB_COMM_CALC, 
B.WB_DATE_COMM_PROC, 
B.WB_NEWRENEW, 
B.WB_COMM_ID, 
1 AS Company, 
B.WB_TIER_PERC, 
B.ITEMNMBR FROM (HartWB_CPICH as B LEFT JOIN HartRM00101 as A ON B.CUSTNMBR = A.CUSTNMBR) 
LEFT JOIN HartRM00301 as C ON B.SLPRSNID = C.SLPRSNID 
WHERE WB_DATE_COMM_PROC <= # 11/30/2005 # and  WB_DATE_COMM_PROC >= # 11/30/2004 # 
and SLPRSNID = '109757         '

UNION ALL
 
Replace this:
# 11/30/2005 #
with this:
#11/30/2005#

You have 4 similar replace to do.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top