|
Here's a first pass.... <<SNIP>>
The problem with the above....if for instance you have
Component Warehouse Finished
Item Id Quantity Item
ABC123 N1 10 7777
ABC123 N1 15 7777
ABC123 N1 18 7777
ABC123 N1 25 7777A
ABC123 N1 7 7777A
ABC123 N1 13 7777A
Which finished Item do you want to chose? They both appear 3
times.
<<SNIP>>
On Mon, Apr 19, 2010 at 4:19 PM, <Peter_Vidal@xxxxxxxx> wrote:
<<SNIP>>
What I want is (by using the component item and the warehouse id) to pull in the FINISHED ITEM that is most often associated with a component item (in this case, 7777A) and the total
QUANTITY for that FINISHED ITEM (in this case, 45 (25 + 7 +
13)). In addition, I want to include the file and this new
logic in this SQL Statement (that is currently running):
SELECT I.HOUSE, I.ITNBR, I.PLANIB,
R.ITCLS, R.ITDSC, R.ENGNO, R.ITTYP,
P.PODUD, P.POSTD, P.POQTY, P.PORID,
I.ACREC
FROM
ITEMBL I, ITMRVA R, PLNORD P
WHERE
I.ITNBR = P.POITM AND
I.HOUSE = P.POPLWH AND
I.ITNBR = R.ITNBR AND
I.ACREC = 'S' AND
R.STID = 'N1P' AND
(I.HOUSE LIKE 'N%')
Any ideas? Any help is greatly appreciated.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.