>SELECT VAL(Customer.CODE) AS ValCode,Invhead.*, Ordhead.location, Ordhead.entered, ; > Ordhead.priorityorder,Ordhead.customerpo,Ordhead.daterequired,Ordhead.comm1, ; > Ordhead.comm2, Ordhead.comm3, Ordhead.terms, Customer.NAME,Customer.CODE, Customer.creditlmt, ; > Customer.einnumber, Customer.specialdisc, Customer.dollarsuse, Ordhead.customerid, ; > Customer.Country AS CustCountry, ProdQty.TotOrdered,ProdQty.TotAllocated, ; > ProdQty.TotShipped,.F. AS Ok,RdyToShip.RdyToShip,Shipped.Shipped, ; > ProdQty.SpecialOrd,ALLTRIM(STR(Ordhead.OrderId))+IIF(Ordhead.SBO,"B"," ") AS DispOrdNo, ; > Customer.OnHold ; > FROM frantisi!Invhead, frantisi!Ordhead, frantisi!Customer, frantisi!ProdQty, ; > frantisi!RdyToShip,frantisi!Shipped ; > WHERE Ordhead.customerid = Customer.customerid ; > AND Invhead.OrderId = Ordhead.OrderId ; > AND Invhead.OrderId = Shipped.OrderId ; > AND (((EMPTY(?ldDateReqd)) OR (Ordhead.daterequired <= ?ldDateReqd)) ; > OR NOT EMPTY(Invhead.Picked) ) AND ((?lnLocn= 0) ; > OR (Ordhead.location = ?lnLocn)) AND EMPTY(DispatchDate) ; > ORDER BY 1,Invhead.InvoiceNo >>