Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I am working on the following access query:

SELECT DISTINCT C.[Serial Numbers], C.[Sell Through Quantity], SellThruMaster.[Product Number (SKU)], SellThruMaster.[Product Line Id], SellThruMaster.[Seller - Company ID], SellThruMaster.[Seller - Company Name], SellThruMaster.[Trans Date], SellThruMaster.[Trans Doc ID], SellThruMaster.[Relationship Sell Thru Qty], SellThruMaster.[Relationship Sell Thru Option Qty], SellThruMaster.[Eclipse ID], MCCMaster.[MC Charge Cd], IIf(IsNull([MCCMaster].[MC Charge Cd]) Or [MCCMaster].[MC Charge Cd]='','Eligible',IIf(Left([MCCMaster].[MC Charge Cd],2)='72' Or Left([MCCMaster].[MC Charge Cd],2)='74' Or Left([MCCMaster].[MC Charge Cd],2)='79' Or Left([MCCMaster].[MC Charge Cd],2)='A9','Not Eligible-End User Deals','Eligible')) AS [MC Eligibility]
FROM (SerialFlatMaster LEFT JOIN
SellThruMaster ON (SerialFlatMaster.[HP Product ID] = SellThruMaster.[Product Number (SKU)]) AND (SerialFlatMaster.[company Name]<>SellThruMaster.[Seller - Company Name]) AND (SerialFlatMaster.[Transaction Date] = SellThruMaster.[Trans Date]) AND (SerialFlatMaster.[Transaction Doc ID] = SellThruMaster.[Trans Doc ID]) AND (SerialFlatMaster.[Company ID] = SellThruMaster.[Seller - Company ID]))

LEFT JOIN
(SELECT DISTINCT sum (A.[Sell Through Quantity]) AS [Sell Through Quantity],A.[Serial Numbers] FROM SerialFlatMaster  A GROUP BY A.[Serial Numbers]) AS C
on A.[serial numbers] = C.[serial numbers]
LEFT JOIN
MCCMaster ON SellThruMaster.[Eclipse ID] = MCCMaster.[Deal Num];



In this, I am getting the following error..

syntax error (missing operator) in query expression 'A.[serial numbers] = C.[serial numbers]
LEFT JOIN 
MCCMaster ON SellThruMaster.[Eclipse ID] = MCCMaster.[Deal Num]'.


any one Please have a look at the syntax and ignore the columns which I am selecting initially and suggest me where the issue is..

Regards,
Posted
Updated 26-Jul-11 21:35pm
v2
Comments
walterhevedeich 27-Jul-11 3:25am    
What's the exact error message?
Raj.rcr 27-Jul-11 3:30am    
syntax error (missing operator) in query expression 'A.[serial numbers] = C.[serial numbers]
LEFT JOIN
MCCMaster ON SellThruMaster.[Eclipse ID] = MCCMaster.[Deal Num]'.
[no name] 27-Jul-11 4:45am    
Put line breaks at braces and indent the query properly. You'll be able to locate the problem yourself.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900