|
|
发表于 2009/8/6 17:09:58
|
显示全部楼层
建立一个视图如下:
CREATE VIEW dbo.MO_ItemLot
SELECT
lt.INCTLNUM AS LotNumber,
ltord.VCWID AS WC,
ltord.ORDNUM AS MONumber,
REPLACE(STR(ltord.LINENUM, 3), ' ', '0') AS LNO,
--ltord.LINENUM AS LNO,
ltord.LINETYP AS LineType,
ltord.ITEMNUM AS ItemNumber,
ltord.QTYRCV AS ReceiptQty,
lt.INRCVDAT as FirstReceiptDate
FROM
dbo.Mfg_INCONTRL lt INNER JOIN
dbo.Mfg_ORDCNTRL ltord ON lt._ORDINC_OwnRow = ltord._Row
WHERE (ltord.ORDTYP = 'M')
然后根据该视图ItemNumber + LotNumber与销售SHIP关联
根据MO +LNO与MO单具体信息关联 |
|