Dynamics GP BOM Export – Part 6

Dynamics GP BOM Export  – Part 6

USE [COMPANYDB]
go
/****** Object:  View [dbo].[BOM6]    Script Date: 09/04/2013 19:37:00 ******/
SET ansi_nulls ON
go
SET quoted_identifier ON
go
CREATE VIEW [dbo].[BOM6]
AS
SELECT TOP (100) PERCENT dbo.bom5.item0,
dbo.bom5.item1,
dbo.bom5.item2,
dbo.bom5.item3,
dbo.bom5.item4,
dbo.bom5.item5,
dbo.bm010115.cpn_i           AS ITEM6,
dbo.bm010115.cpn_i           AS ITEM7,
dbo.bm010115.cpn_i           AS ITEM8,
dbo.bm010115.cpn_i           AS ITEM9,
dbo.bm010115.bomcat_i,
dbo.bm010115.bomname_i,
6                            AS [LEVEL],
dbo.bm010115.effectiveindate_i,
dbo.bm010115.bomtype_i,
dbo.iv00101.stndcost,
dbo.bm010115.backflushitem_i,
dbo.bm010115.locncode,
dbo.bm010115.cpn_i           AS ITEM10,
dbo.bm010115.position_number,
dbo.iv00101.itemdesc,
dbo.bm010115.quantity_i,
dbo.bm010115.uofm,
dbo.bom5.zero,
dbo.bom5.one,
dbo.bom5.two,
dbo.bom5.three,
dbo.bom5.four,
dbo.bom5.five,
dbo.bm010115.position_number AS six,
dbo.bom5.seven,
dbo.bom5.eight,
dbo.bom5.nine,
dbo.bom5.q0,
dbo.bom5.q1,
dbo.bom5.q2,
dbo.bom5.q3,
dbo.bom5.q4,
dbo.bom5.q5,
dbo.bm010115.quantity_i      AS Q6,
dbo.bom5.q7,
dbo.bom5.q8,
dbo.bom5.q9
FROM   dbo.bom5
INNER JOIN dbo.bm010115
ON dbo.bom5.bomname_i = dbo.bm010115.bomname_i
AND dbo.bom5.bomcat_i = dbo.bm010115.bomcat_i
AND dbo.bom5.item5 = dbo.bm010115.ppn_i
INNER JOIN dbo.iv00101
ON dbo.bm010115.cpn_i = dbo.iv00101.itemnmbr
ORDER  BY dbo.bm010115.position_number