Error in WHERE Clause

D

Dee

Can anyone tell how I am getting an Error in WHERE clause here? This
started happening when I added the ItemStatus <>"X" to my query... too many
parameters?

Please advise.....

PARAMETERS [Enter Start Date] DateTime, [Enter End Date] DateTime, [Enter
Qube Sales Rep Number] Text ( 255 );
SELECT QubeCustomers.CHID, QubeCustomers.Company, QubeCustomers.Address AS
QubeAddress, QubeCustomers.Address2 AS QubeAddress2, QubeCustomers.City AS
QubeCity, QubeCustomers.State AS QubeState, QubeCustomers.Zip AS QubeZip,
QubeCustomers.Country AS QubeCountry, QubeCustomers.TYPE,
QubeCustomers.Contact, QubeCustomers.PHONE, QubeCustomers.FAX,
QubeShipAddress.CompanyName, QubeShipAddress.Address AS QubeShipAddress,
QubeShipAddress.Address2 AS QubeShipAddress2, QubeShipAddress.City AS
QubeShipCity, QubeShipAddress.State AS QubeShipState, QubeShipAddress.Zip AS
QubeShipZip, QubeShipAddress.Country AS QubeShipCountry,
QubeShipAddress.EndUser, QubeOrders.DSO, QubeOrders.OrderDate,
QubeOrders.PONo, QubeOrders.OrderSubtotal, QubeOrders.SpareParts,
QubeOrderDetails.LineItem, QubeOrderDetails.Quantity,
QubeOrderDetails.ItemCode, QubeOrderDetails.Description,
QubeOrderDetails.UnitPrice, QubeCustomers.QubeSalesRep, Channel.[Qube Sales
Rep Number], QubeOrders.SalesType, QubeOrders.Status,
QubeOrderDetails.ItemStatus, QubeOrderDetails.QLN
FROM ((QubeCustomers INNER JOIN Channel ON QubeCustomers.CHID =
Channel.CHID) INNER JOIN QubeShipAddress ON QubeCustomers.QCN =
QubeShipAddress.QCN) INNER JOIN (QubeOrders INNER JOIN QubeOrderDetails ON
QubeOrders.DSO = QubeOrderDetails.DSO) ON QubeShipAddress.QSN =
QubeOrders.QSN
WHERE (((QubeOrders.OrderDate) Between [Enter Start Date] And [Enter End
Date]) AND ((QubeCustomers.QubeSalesRep)=[Enter Qube Sales Rep Number]) AND
((QubeOrders.SalesType)="O" Or (QubeOrders.SalesType)="R" Or
(QubeOrders.SalesType)="I") AND (Not (QubeOrders.Status)="X") AND (Not
(QubeOrderDetails.ItemStatus)="X"));

Thanks,

Dee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top