i'm new to Union queries and having a problem trying to figure out how to correct my query.
I have a query named "Kits" this links the tables with the parent and the component items that make up the Kit.
The Kits query result is basically this:
where the last 3 columns are from the components (Kit table) of the parent item (ProductNumber).
The LineSeqNumber is the order of the component for the parent.
When I do the UNION query it's to combine the component items into the ProductNumber as I can only use the ProductNumber field to list ALL the items for the order.
If I include the LineSeqNumber it does not work and shows me duplicate values. When I leave it out it gives me the data with the Component items in the ProductNumber with the parent item.
I need the LineSeqNumber so that the sortorder of the Parent and component is sorted as it should be and together on the results view.
I realize that it's somehow b/c the LineSeqNumber does not exist on the parent side and only in the component side of the Kit.
please help.
thank you in advance.
I have a query named "Kits" this links the tables with the parent and the component items that make up the Kit.
The Kits query result is basically this:
Code:
OrderNo ProductNumber Qty Unit_Price ComponentItemCode QtyPerAssemblyStd LineSeqNumber
S101519 DA/DRCK102/108 1 $692.50 LC041 1 1
S101519 DA/DRCK102/108 1 $692.50 LC042 1 2
S101519 DA/DRCK102/108 1 $692.50 LC050 1 3
S101519 DA/DRCK102/108 1 $692.50 LC071 1 4
S101519 DA/DRCK102/108 1 $692.50 LC074 1 5
S101519 DA/DRCK102/108 1 $692.50 LC092 1 6
S101519 DA/DRCK102/108 1 $692.50 LC202 1 7
S101519 DA/DRCK102/108 1 $692.50 LC133 1 8
S101519 DA/DRCK102/108 1 $692.50 LC128 1 9
S101519 DA/DRCK102/108 1 $692.50 LC123 1 10
S101519 GX202 2 $12.00 GX202NS 1 1
S101519 GX202 2 $12.00 GX200-STAND 1 2
S101519 GX206 2 $12.00 GX206NS 1 1
S101519 GX206 2 $12.00 GX200-STAND 1 2
S101519 GX214 2 $12.00 GX214NS 1 1
S101519 GX214 2 $12.00 GX200-STAND 1 2
where the last 3 columns are from the components (Kit table) of the parent item (ProductNumber).
The LineSeqNumber is the order of the component for the parent.
When I do the UNION query it's to combine the component items into the ProductNumber as I can only use the ProductNumber field to list ALL the items for the order.
If I include the LineSeqNumber it does not work and shows me duplicate values. When I leave it out it gives me the data with the Component items in the ProductNumber with the parent item.
I need the LineSeqNumber so that the sortorder of the Parent and component is sorted as it should be and together on the results view.
I realize that it's somehow b/c the LineSeqNumber does not exist on the parent side and only in the component side of the Kit.
please help.
thank you in advance.