carloshgogmail
Programmer
this is what i have
Complete Database is attached on access format
Sample table
Category Model Model Parent Item Item Explosion Num Explosion Level
PDP5807SYSHD TH-58PH10UKA TH-58PH10UKA MPPDP-20071001 1 1
PDP5807SYSHD TH-58PH10UKA TH-58PH10UKA TK1NWPTU 2 1
PDP5807SYSHD TH-58PH10UKA TK1NWPTU T4F2AX0041 3 2
PDP5807SYSHD TH-58PH10UKA TK1NWPTU T5E7756 4 2
PDP5807SYSHD TH-58PH10UKA TK1NWPTU T5EJ09750 5 2
PDP5807SYSHD TH-58PH10UKA TK1NWPTU TK2NWPTU 6 2
PDP5807SYSHD TH-58PH10UKA TK2NWPTU THEL0429 7 3
PDP5807SYSHD TH-58PH10UKA TK2NWPTU THTF011N 8 3
PDP5807SYSHD TH-58PH10UKA TK2NWPTU TK3NWPTU 9 3
PDP5807SYSHD TH-58PH10UKA TK3NWPTU K5D103BMA001 10 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU K5D502BNA007 11 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU THTF011N 12 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2A19005-1 13 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AA19005-1 14 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AD00701 15 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AD00801 16 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AD00901 17 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM6463-1 18 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TQFD532 19 4
PDP5807SYSHD TH-58PH10UKA TQFD532 T4EX216005 20 5
PDP5807SYSHD TH-58PH10UKA TQFD532 TYZQF014 21 5
I need to get this result
<ModelCategory model_x0020_category="PDP5807SYSHD">
<Models Model="TH-58PH10UKA">
<Items Item="MPPDP-20071001" />
<Items Item="TK1NWPTU" />
<Items Item="T4F2AX0041" />
<Items Item="T5E7756" />
<Items Item="T5EJ09750" />
<Items Item="TK2NWPTU" />
<Items Item="THEL0429" />
<Items Item="THTF011N" />
<Items Item="TK3NWPTU" />
<Items Item="K5D103BMA001" />
<Items Item="K5D502BNA007" />
<Items Item="THTF011N " />
<Items Item="TMM2A19005-1" />
<Items Item="TMM2AA19005-1" />
<Items Item="TMM2AD00701" />
<Items Item="TMM2AD00801" />
<Items Item="TMM2AD00901" />
<Items Item="TMM6463-1" />
<Items Item="T4EX216005" />
<Items Item="TYZQF014" />
</Models>
</ModelCategory>
This is what I have already and no idea on how to get the desire result
<ModelCategory model_x0020_category="PDP5807SYSHD">
<Models Model="TH-58PH10UKA">
<Items Item="MPPDP-20071001" />
<Items Item="TK1NWPTU" />
<Items Item="T4F2AX0041" />
<Items Item="T5E7756" />
<Items Item="T5EJ09750" />
<Items Item="TK2NWPTU" />
<Items Item="THEL0429" />
<Items Item="THTF011N" />
<Items Item="TK3NWPTU" />
<Items Item="K5D103BMA001" />
<Items Item="K5D502BNA007" />
<Items Item="THTF011N " />
<Items Item="TMM2A19005-1" />
<Items Item="TMM2AA19005-1" />
<Items Item="TMM2AD00701" />
<Items Item="TMM2AD00801" />
<Items Item="TMM2AD00901" />
<Items Item="TMM6463-1" />
<Items Item="T4EX216005" />
<Items Item="TYZQF014" />
</Models>
</ModelCategory>
This is my Query
--------------------------------------------------------- Header Model Category
SELECT [model category],
(----------------------------------------------------------- Model
SELECT Model,
(------------------------------------------------------ Item
SELECT Item
FROM TBL_BOM Items WITH (nolock)
WHERE
Items.model = Models.model and
Items.[model category] = ModelCategory.[model category]
GROUP BY Item, model, [model category]
FOR XML AUTO, TYPE--, ELEMENTS
)--------------------------------------------------- End Item
FROM TBL_BOM Models WITH (nolock)
WHERE Models.[model category] = ModelCategory.[model category]
GROUP BY Model, [model category]
FOR XML AUTO, TYPE--, ELEMENTS
)------------------------------------------------------------ End Model
FROM tbl_bom ModelCategory WITH (nolock)
GROUP BY [model category]
ORDER BY [model category]
FOR XML AUTO, TYPE
------------------------------------------------------ End Header Model Category
any idea
Complete Database is attached on access format
Sample table
Category Model Model Parent Item Item Explosion Num Explosion Level
PDP5807SYSHD TH-58PH10UKA TH-58PH10UKA MPPDP-20071001 1 1
PDP5807SYSHD TH-58PH10UKA TH-58PH10UKA TK1NWPTU 2 1
PDP5807SYSHD TH-58PH10UKA TK1NWPTU T4F2AX0041 3 2
PDP5807SYSHD TH-58PH10UKA TK1NWPTU T5E7756 4 2
PDP5807SYSHD TH-58PH10UKA TK1NWPTU T5EJ09750 5 2
PDP5807SYSHD TH-58PH10UKA TK1NWPTU TK2NWPTU 6 2
PDP5807SYSHD TH-58PH10UKA TK2NWPTU THEL0429 7 3
PDP5807SYSHD TH-58PH10UKA TK2NWPTU THTF011N 8 3
PDP5807SYSHD TH-58PH10UKA TK2NWPTU TK3NWPTU 9 3
PDP5807SYSHD TH-58PH10UKA TK3NWPTU K5D103BMA001 10 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU K5D502BNA007 11 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU THTF011N 12 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2A19005-1 13 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AA19005-1 14 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AD00701 15 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AD00801 16 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM2AD00901 17 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TMM6463-1 18 4
PDP5807SYSHD TH-58PH10UKA TK3NWPTU TQFD532 19 4
PDP5807SYSHD TH-58PH10UKA TQFD532 T4EX216005 20 5
PDP5807SYSHD TH-58PH10UKA TQFD532 TYZQF014 21 5
I need to get this result
<ModelCategory model_x0020_category="PDP5807SYSHD">
<Models Model="TH-58PH10UKA">
<Items Item="MPPDP-20071001" />
<Items Item="TK1NWPTU" />
<Items Item="T4F2AX0041" />
<Items Item="T5E7756" />
<Items Item="T5EJ09750" />
<Items Item="TK2NWPTU" />
<Items Item="THEL0429" />
<Items Item="THTF011N" />
<Items Item="TK3NWPTU" />
<Items Item="K5D103BMA001" />
<Items Item="K5D502BNA007" />
<Items Item="THTF011N " />
<Items Item="TMM2A19005-1" />
<Items Item="TMM2AA19005-1" />
<Items Item="TMM2AD00701" />
<Items Item="TMM2AD00801" />
<Items Item="TMM2AD00901" />
<Items Item="TMM6463-1" />
<Items Item="T4EX216005" />
<Items Item="TYZQF014" />
</Models>
</ModelCategory>
This is what I have already and no idea on how to get the desire result
<ModelCategory model_x0020_category="PDP5807SYSHD">
<Models Model="TH-58PH10UKA">
<Items Item="MPPDP-20071001" />
<Items Item="TK1NWPTU" />
<Items Item="T4F2AX0041" />
<Items Item="T5E7756" />
<Items Item="T5EJ09750" />
<Items Item="TK2NWPTU" />
<Items Item="THEL0429" />
<Items Item="THTF011N" />
<Items Item="TK3NWPTU" />
<Items Item="K5D103BMA001" />
<Items Item="K5D502BNA007" />
<Items Item="THTF011N " />
<Items Item="TMM2A19005-1" />
<Items Item="TMM2AA19005-1" />
<Items Item="TMM2AD00701" />
<Items Item="TMM2AD00801" />
<Items Item="TMM2AD00901" />
<Items Item="TMM6463-1" />
<Items Item="T4EX216005" />
<Items Item="TYZQF014" />
</Models>
</ModelCategory>
This is my Query
--------------------------------------------------------- Header Model Category
SELECT [model category],
(----------------------------------------------------------- Model
SELECT Model,
(------------------------------------------------------ Item
SELECT Item
FROM TBL_BOM Items WITH (nolock)
WHERE
Items.model = Models.model and
Items.[model category] = ModelCategory.[model category]
GROUP BY Item, model, [model category]
FOR XML AUTO, TYPE--, ELEMENTS
)--------------------------------------------------- End Item
FROM TBL_BOM Models WITH (nolock)
WHERE Models.[model category] = ModelCategory.[model category]
GROUP BY Model, [model category]
FOR XML AUTO, TYPE--, ELEMENTS
)------------------------------------------------------------ End Model
FROM tbl_bom ModelCategory WITH (nolock)
GROUP BY [model category]
ORDER BY [model category]
FOR XML AUTO, TYPE
------------------------------------------------------ End Header Model Category
any idea