Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT A.ItemNo_ ItemNo,
- ISNULL(i.description, '') ItemName,
- A.SerialNo_,
- A.SerialCode,
- A.SerialNum,
- A.FactoryNo_,
- A.ManufactureDate,
- A.ManufactureShifts,
- A.SerialError,
- A.CreatedBySite,
- rs.description SerialErrorName,
- A.SerialShape,
- A.CreatedBySite SiteRef,
- A.StatusID,
- D.AttributeValueName StatusName,
- A.Quanlity,
- A.CatePile CatPile,
- A.Diameter,
- '' Mui,
- A.PileLength,
- A.Piernose,
- A.BottomLong,
- A.TopLong TopLong,
- A.RealLong,
- A.JobOrder Job,
- A.Suffix Suffix,
- A.RowPointerRef,
- A.Notes,
- A.Descriptions,
- A.Barcode,
- A.FactorySerialNo, -- Số cọc ở xưởng
- A.FullName ProjName -- Dự án
- FROM NEXTG.dbo.Item_Serials A
- LEFT JOIN NEXTG.dbo.ItemAttributes D
- ON D.AttributeValue = A.StatusID
- AND D.AttributeNo_ = 'A07'
- LEFT JOIN ERP.SyteLine_Apps.dbo.item_mst i
- ON A.CreatedBySite = i.site_ref
- AND i.item = A.ItemNo_
- LEFT JOIN ERP.SyteLine_Apps.dbo.reason_mst rs
- ON rs.site_ref = A.CreatedBySite
- AND rs.reason_code = A.SerialError
- AND rs.reason_class = 'MFG SCRAP'
- WHERE A.CreatedBySite = 'PVC'
- AND A.StatusID = 1
- AND A.ItemNo_ IS NOT NULL
- AND A.SerialNo_ IS NOT NULL
- AND A.ManufactureDate IS NOT NULL
- AND A.Quanlity IN ( 'A', 'B', 'C', 'H' )
- AND dbo.FAB_IsPileItem(A.ItemNo_) = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement