I need an effeciant way to return information from the last purchase by the customer for a current order's line items which don't include the current order # to place the information on an Invoice.
Orders = OrderNo, OrderDate, CustomerID
OrderLines = OrderNo, ProductID, Qty
Data needed to be returned (restricted by CustomerID) for current order:
OrderNo | ProductID | Qty | "LastPurchaseDate" | "LastPurchaseQty"
Thanks for your time!