special sum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that contains the sales of a store with the fields as SaleID(autonumber), CustomerID, ProductID, Qty, Price, Day {of course the CustomerID, productID are external keys} as a fact i want to make a query that can show me in a period of a month that a specific CustomerID has ordered the total amount of ProductID at a total Price for that product...
i can't figure out how i will count the products in the Sales table

Every help is welcome and really will give me a big hel
Sotiris_s
 
I don't see how you're storing a date in the table, but let me assume that
Day [NOTE: bad idea to use Day, Month, Year, Date, Name, etc. as the names
of fields -- these are the names of properties and functions in ACCESS, and
you can greatly confuse it if you use them as names] is a date/time field
that is storing the date.

SELECT CustomerID, ProductID, Sum(Qty), Sum(Price)
FROM Tablename
WHERE [Day] Between [Enter the starting date:] And [Enter the ending date:]
GROUP BY CustomerID, ProductID
ORDER BY CustomerID;

--
Ken Snell
<MS ACCESS MVP>

sotiris_s said:
I have a table that contains the sales of a store with the fields as
SaleID(autonumber), CustomerID, ProductID, Qty, Price, Day {of course the
CustomerID, productID are external keys} as a fact i want to make a query
that can show me in a period of a month that a specific CustomerID has
ordered the total amount of ProductID at a total Price for that product....
 
Back
Top