Steve,
You can change the second select to eliminate 1's w/o 3's
SELECT *, 000000000 AS rn ;
FROM test ;
WHERE Status = "1" ;
AND ItemNum IN ( ;
SELECT DIST ItemNum FROM s3) ;
ORDER BY ItemNum, Cust, Sku ;
INTO CURSOR s1 READWRITE
>
>Thank you for doing that. Haven't had a chance to really look at your code yet. But following that with:
>
>
>select * from crsResult order by itemNum
>
>
>Almost gets the exact result I need...I just need to lose the case where there is status code of 1 and no 3's to go with it.
>
>I must work with it more to guarantee that the above SELECT will always return them in the right order (NULLs for each column at the bottom of the group).
>
>Thanks! :)
--sb--