Joined: 03 Jun 2011
Online Status: Offline
Posts: 2
Topic: Don't Know Where to Start Posted: 03 Jun 2011 at 4:52am
Here's my problem:
I have a table of "order lines" (lines on an invoice) and a table of "orders". The order-lines table is related to the orders table via an order-id column (1 order has many order-lines). The order-lines table has a component-code column to keep track of the type of product ordered on that line.
I need to generate a report that lists ALL of the order-lines from each order that has at least one order-line with a component code of '49-003'.
I've written many reports, but this one has me stumped! I don't even know where to start. It seems like it should be easy, but I can't quite wrap my brain around it.
Joined: 02 Jun 2011
Location: South Africa
Online Status: Offline
Posts: 47
Posted: 03 Jun 2011 at 6:33am
You would need to create a Stored Procedure.
You shoudl have an inner query that accepts a parameter (the component code). In the inner query you would select the order number for the component.Then you would join the inner query to an outer query on the order number. Thereby selecting all the order lines for all orders that has this component.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum