Yield Detail Report by Customer By Date Range query
 

SELECT Custname, Qainsp.Wono, Part_no, Revision, LotSize, InspQty, FailQty, PassQty, Yield, Dept_name, Date, Qaseqmain AS QALink ;
 FROM Qainsp, Woentry, Inventor, Customer, Depts ;
 WHERE Inventor.Uniq_key = Woentry.Uniq_key ;
 AND Woentry.Custno = Customer.Custno ;
 AND Qainsp.Wono = Woentry.Wono ;
 AND Qainsp.Dept_id = Depts.Dept_id ;
 AND Date >= dStart AND Date <= dEnd ;
 AND Qainsp.Dept_id IN (SELECT Dept_id FROM ZD) ;
 AND Woentry.Custno IN (SELECT Custno FROM ZCu) ;
 AND Qainsp.Wono IN (SELECT Wono FROM ZW) ;
 ORDER BY Date, Custname, Part_no ;
 INTO CURSOR ZYieldDt