J
James
How can i get a list of customers that haven't placed an order in 90 days? I
have two tables, Customers and Orders. in the orders table i have a
CustomerID and a Orderdate Field. i have created a select statement that
returns the count of orders per customer in 90 days, but it never returns
the customer names that havn't placed an order yet. the strange thing is, if
i remove the where 90 day where clause, it does count the customers that
havn't placed an order.
SELECT Customers.CompanyName, Count(Order.OrderID) AS CountOfOrderID
FROM Customers LEFT JOIN [Order] ON Customers.CustomerID = Order.CustomerID
WHERE (((Order.Orderdate)>Date()-90))
GROUP BY Customers.CompanyName;
have two tables, Customers and Orders. in the orders table i have a
CustomerID and a Orderdate Field. i have created a select statement that
returns the count of orders per customer in 90 days, but it never returns
the customer names that havn't placed an order yet. the strange thing is, if
i remove the where 90 day where clause, it does count the customers that
havn't placed an order.
SELECT Customers.CompanyName, Count(Order.OrderID) AS CountOfOrderID
FROM Customers LEFT JOIN [Order] ON Customers.CustomerID = Order.CustomerID
WHERE (((Order.Orderdate)>Date()-90))
GROUP BY Customers.CompanyName;