ICM Query - PO History Button Sequel Statement

Here is the sequel statement that generates the information in the PO History button from the inventory page 2 screen.  The uniq_key is the field identifying the part you are looking for.  In this sequel, records are gathered up to ten records. You can change the sequel if you would like less records.

SELECT TOP 10 Pomain.podate, Supinfo.supname, Pomain.ponum,;
  Poitems.partmfgr, Poitems.costeach, Poitems.ord_qty, Poitems.mfgr_pt_no;
FROM ;
    manex!pomain,;
    manex!supinfo,;
    manex!poitems;
 WHERE ( ( (  Pomain.ponum == Poitems.ponum;
   AND  Supinfo.uniqsupno == Pomain.uniqsupno );
   AND  Poitems.uniq_key == ( ?gUniq_key ) );
   AND  NOT (Poitems.lcancel ) );
   AND  (  Pomain.postatus = ( "OPEN" );
   OR  Pomain.postatus = ( "CLOSED" ) );
 ORDER BY Pomain.podate DESC