I want to thank you for your time, I was looking at my initial request
for help and I failed to mention that the records I am looking for are
from
only one customer. Here is the 2 queries:
“CustomerNoSales†query
SELECT DISTINCT OrderDetails.ProductName2, OrderDetails.PrdtID,
ShipAddress.CID, Last(ShipAddress.ShippedDate) AS LastOfShippedDate
FROM ShipAddress INNER JOIN OrderDetails ON ShipAddress.OID =
OrderDetails.OID
GROUP BY OrderDetails.ProductName2, OrderDetails.PrdtID, ShipAddress.CID
HAVING (((ShipAddress.CID)=[Forms]![OrderForm]![CID]) AND
((Last(ShipAddress.ShippedDate))<=Date()-14))
ORDER BY OrderDetails.PrdtID;
“CustomerSales†query
SELECT DISTINCT OrderDetails.ProductName2, OrderDetails.PrdtID,
ShipAddress.CID, Last(ShipAddress.ShippedDate) AS LastOfShippedDate
FROM ShipAddress INNER JOIN OrderDetails ON ShipAddress.OID =
OrderDetails.OID
GROUP BY OrderDetails.ProductName2, OrderDetails.PrdtID, ShipAddress.CID
HAVING (((ShipAddress.CID)=[Forms]![OrderForm]![CID]))
ORDER BY OrderDetails.PrdtID;
The way the queries choose the customer is by an open form named
"OrderForm" and subform named "OrderDetails"
What I need is to see what products (PrdtID) this customer has not
purchased
the last 14 days (CustomerNoSales) that he had purchase before
(CustomerSales)
vanderghast said:
You can have dup, so the two numbers of records won't be the same, even
if
the value will all be "in" the other table.
Example:
Table1.Names = "Mary", "John", "Joe"
Table2.Names = "Mary", "John", "Mary", "John", "Joe"
Everyone in table2.Names *is* in Table1.Names, but there is 5 values in
the
second sequence, and only 3 in the first sequence.
Again, to repeat myself, have you some 'data sample' which would explain
what you say by "it does not work" , and what it should be if it was "to
work" ?
Vanderghast, Access MVP
.