WO Query - Work Order Stat Basic Query

 

 

SELECT woentry.custno, woentry.wono, woentry.openclos, woentry.due_date, woentry.bldqty, woentry.balance, ;

       woentry.reledate,;

      inventor.parT_no, inventor.revision, inventor.descript, ;

       woentry.sono,due_dts.due_dts as SOdueDt,due_dts.commit_dts as SO_commdt,due_dts.qty as SOqty;

      FROM woentry,inventor,due_dts;

      WHERE openclos <> "Closed" and openclos <> "Cancel";

            and inventor.uniq_key = woentry.uniq_key;

            AND due_dts.uniqueln = woentry.uniqueln;

      ORDER BY woentry.wono;

      INTO CURSOR wostuff

BROWSE LAST nowait

 

 

     

** work center locations

 

SELECT wostuff.wono,dept_id, curr_qty;

      FROM wostuff, dept_qty;

      WHERE wostuff.wono = dept_qty.wono;

      ORDER BY wostuff.wono,dept_id;

      INTO CURSOR whereitis

     

BROWSE LAST nowait

 

** wo shortages

 

SELECT distinct wostuff.wono,kamain.dept_id,kamain.shortqty,;

      inventor.part_no, inventor.revision, kamain.uniq_key;

      FROM wostuff, kamain, kadetail, inventor;

      WHERE wostuff.wono = kamain.wono;

            AND kamain.kaseqnum = kadetail.kaseqnum;

            AND kamain.uniq_key = inventor.uniq_key;

            AND kamain.shortqty > 0;

      ORDER BY wostuff.wono,inventor.part_no;

      INTO CURSOR whatitis

     

BROWSE LAST nowait

 

 

 

SELECT WHATITIS.WONO, WHATITIS.PART_NO, WHATITIS.SHORTQTY, poitems.ponum, POMAIN.POSTATUS,  ;

      poitems.itemno,poitschd.balance, ;

      poitschd.schd_date, SUPINFO.SUPNAME ;

      from poitems, pomain, POITSCHD, SUPINFO, WHATITIS;

      where POITEMS.PONUM = POMAIN.PONUM;

            AND POITSCHD.UNIQLNNO = POITEMS.UNIQLNNO;

            AND POMAIN.postatus <> "CANCEL" ;

            AND POMAIN.postatus <> "CLOSED" ;

            AND POITSCHD.BALANCE > 0;

            AND SUPINFO.UNIQSUPNO = POMAIN.UNIQSUPNO;

            AND POITEMS.UNIQ_KEY = WHATITIS.UNIQ_KEY;

      ORDER BY WHATITIS.WONO, WHATITIS.PART_NO,POITEMS.PONUM,POITEMS.ITEMNO,POITSCHD.SCHD_DATE;

      INTO CURSOR WHENISIT

     

BROWSE LAST NOWAIT