I have a list of customerids, orderids and order dates that I want to use in another query to determine if the customer has ordered again since this date.
Example Data:
CustomerID OrderID OrderDate
6619 16034 2012-11-15 10:23:02.603
6858 18482 2013-03-25 11:07:14.680
4784 17897 2013-02-20 14:45:43.640
5522 16188 2012-11-22 14:53:49.840
6803 18016 2013-02-28 10:41:16.713
Query:
SELECT dbo.[Order].CustomerID, dbo.[Order].OrderID, dbo.[Order].OrderDate
FROM dbo.[Order] INNER JOIN
dbo.OrderLine ON dbo.[Order].OrderID = dbo.OrderLine.OrderID
WHERE (dbo.OrderLine.ProductID in (42, 44, 45, 46,47,48))
If you need anything else, just ask.
UPDATE::
This query brings back the results as shown above
Need to know if the customer has ordered again since, for any product id after ordering one of the products in the query above..
Mike