>Bill,
>
>I have to include VENDNO otherwise the next join fails.
>
>INNER JOIN apvend01 v;
> ON S.vendno = V.vendno;
>
>
>
>Jeff
Right, but having vendno in there doesn't give us the grouping we want, so we need another way of getting the vendno.
Try patching this in instead of what you have.
It runs OK here on its own.
I can't test the full query here.
SELECT * FROM ( SELECT i.item, a.lrecdte, i.vendno, v.company FROM (SELECT ITEM , MAX(LRECDTE) AS lrecdte FROM icsupl01 GROUP BY item ) AS a INNER JOIN icsupl01 i ON i.item = a.item AND i.lrecdte = a.lrecdte INNER JOIN apvend01 v ON i.vendno = v.vendno) as q
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.