SET STEP ON
select usxemp_, emname, cItemrech.iruser, cItemrech.irsrc, COUNT(cOoline.olxpal) ;
from cItemrech, cOoline, cUserfile, cUserxtra, cprempm ;
where (irloc=lcLocTA or irloc=lcLocPM) AND irco=olico AND irloc=oliloc AND irord_=olord_ and irrel_=olrel_ and irsrc='W' AND irqty < 0 AND iritem=olitem AND ;
irloc=oliloc AND irky=olidky AND olfcrg!='Y' AND usid=iruser AND usxid=usid AND ememp_=usxemp_ and (emloc!=38 and emloc!=96 and emloc!=52) ;
group by iruser ;
order by iruser ;
into cursor cXEShip readwrite
|