I need to create a pipe delimited file with the following structure. I tried this in the past, gave up and now trying again. These are product orders.
Assuming there's only 1 line item - no problem:
Header row data includes PONo, InvoiceNo, OrderTotal, etc.
-LineItem1 row data contains Sku, Qty, PriceEach
-Shipment row includes Shipmethod, ShipDate, Tracking
My problem is when there's more than one line item. The delimited file still requires only one header row, but multiple LineItem and Shipment rows as follows.
This is correct:
Header row data includes PONo, InvoiceNo, OrderTotal, etc.
-LineItem1 row data contains Sku, Qty, PriceEach
-Shipment1 row includes Shipmethod, ShipDate, Tracking
-LineItem2 row data contains Sku, Qty, PriceEach
-Shipment2 row includes Shipmethod, ShipDate, Tracking
-LineItem3 row data contains Sku, Qty, PriceEach
-Shipment3 row includes Shipmethod, ShipDate, Tracking
My query is returning a header row for each LineItem which is invalid.
This is incorrect. It has 3 Header rows.
Header row data includes PONo, InvoiceNo, OrderTotal, etc.
-LineItem1 row data contains Sku, Qty, PriceEach
-Shipment1 row includes Shipmethod, ShipDate, Tracking
Header row data includes PONo, InvoiceNo, OrderTotal, etc.
-LineItem2 row data contains Sku, Qty, PriceEach
-Shipment2 row includes Shipmethod, ShipDate, Tracking
Header row data includes PONo, InvoiceNo, OrderTotal, etc.
-LineItem3 row data contains Sku, Qty, PriceEach
-Shipment3 row includes Shipmethod, ShipDate, Tracking
Each line requires a specific number of populated and blank fields so a union query doesn't seem to be the answer. I'm not seeing what is probably a simple solution. It's not like I could manually do this. There could be hundreds of orders. Any suggestions?
thanks!