Just realised - one too many ANDs in select - 3rd line to bottom, at end of line
>select po_main.vendno, po_main.company, po_main.drno, po_main.rcno, po_main.purno, po_main.loctid,;
>po_main.adddate, po_main.addtime, po_main.adduser, po_main.org_rcno, ;
>po_detail.item, po_detail.qtyrec, po_detail.umfact,;
>po_detail.umeasur, po_detail.cost, po_detail.lineno, po_detail.taxrate, po_detail.qtyord, po_detail.qtyrec2,;
>po_detail.disc, po_detail.qtyopen;
>from po_main;
>INNER JOIN po_detail on ;
>po_main.purno == po_detail.purno ;
>and po_main.rcno == po_detail.rcno ;
>where alltrim(po_main.purno) == Lcvalue ;
>and alltrim(po_main.rcno) == Lcvalue2 and ;
>AND po_detail.qtyrec2 != 0 ;
>into cursor cur_temp
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.