J
Jeff D'Amelio
This is the SQL for a query I designed last year to
determine who got christmas cards from us. It looked at
total sales of each customer and chose all that were
equal to or above $100. Sort by the total sales of each
customer, in descending order. Also show the customers'
name and address. Now when I run it nothing is found. I
can't imagine what I have done to it in the interim. I
did copy it for 2003, and that doesn't work either. This
is the only way I can think of getting a quick assessment.
Thank you for your assistance in advance.
SELECT Sum(Sales.Amount) AS SumOfAmount, First
(Customers.Store) AS FirstOfStore, First
(Customers.Address1) AS FirstOfAddress1, First
(Customers.City) AS FirstOfCity, First(Customers.State)
AS FirstOfState, First(Customers.Zip) AS FirstOfZip, First
(Customers.Address2) AS FirstOfAddress2, First
(Customers.Contact) AS FirstOfContact
FROM Customers INNER JOIN Sales ON Customers.ID = Sales.ID
WHERE (((Sales.Date) Like "*/*/02"))
GROUP BY Customers.ID
HAVING (((Sum(Sales.Amount))>=100))
ORDER BY Sum(Sales.Amount) DESC;
determine who got christmas cards from us. It looked at
total sales of each customer and chose all that were
equal to or above $100. Sort by the total sales of each
customer, in descending order. Also show the customers'
name and address. Now when I run it nothing is found. I
can't imagine what I have done to it in the interim. I
did copy it for 2003, and that doesn't work either. This
is the only way I can think of getting a quick assessment.
Thank you for your assistance in advance.
SELECT Sum(Sales.Amount) AS SumOfAmount, First
(Customers.Store) AS FirstOfStore, First
(Customers.Address1) AS FirstOfAddress1, First
(Customers.City) AS FirstOfCity, First(Customers.State)
AS FirstOfState, First(Customers.Zip) AS FirstOfZip, First
(Customers.Address2) AS FirstOfAddress2, First
(Customers.Contact) AS FirstOfContact
FROM Customers INNER JOIN Sales ON Customers.ID = Sales.ID
WHERE (((Sales.Date) Like "*/*/02"))
GROUP BY Customers.ID
HAVING (((Sum(Sales.Amount))>=100))
ORDER BY Sum(Sales.Amount) DESC;