Results 1 to 4 of 4
  1. #1
    afabris is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2013
    Posts
    4

    Help a new Access user summarize data

    Hi all.

    I am failing at setting up a query to summarize data.

    I have a table that contains the amount of items sold per salesman per month (key + 5 fields: month, year, salesman, item, amount sold).


    In a second table, I have the average price per item per month (key + 4 fields: month, year, item, price).

    I am trying to run a query that shows total sales (amount sold * price) per salesman per year, but I can't do it. I get sum of amounts or sum of prices, I cannot sum the multplication of both.

    Thanks for your time and help!

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Please show us your relationships window as a zipped jpg file.

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Code:
    SELECT TS.Salesyear, TS.Salesman, SUM(TS.Item * TS.Amount * TP.Price)
    FROM tblSales AS TS INNER JOIN tblPrice AS TP
    ON TS.SalesYear = TP.PriceYear 
    AND TS.SalesMonth = TP.PriceMonth
    AND TS.Item = TP.Item
    GROUP BY TS.Salesyear, TS.Salesman;
    Of course, you'll have to change all the table names and field names to match yours.

    I hope you are not using "Month" and "Year" as field names. they are reserved words, and will cause you loads of headaches in the long run.

  4. #4
    afabris is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2013
    Posts
    4
    Quote Originally Posted by Dal Jeanis View Post
    Code:
    SELECT TS.Salesyear, TS.Salesman, SUM(TS.Item * TS.Amount * TP.Price)
    FROM tblSales AS TS INNER JOIN tblPrice AS TP
    ON TS.SalesYear = TP.PriceYear 
    AND TS.SalesMonth = TP.PriceMonth
    AND TS.Item = TP.Item
    GROUP BY TS.Salesyear, TS.Salesman;
    Of course, you'll have to change all the table names and field names to match yours.

    I hope you are not using "Month" and "Year" as field names. they are reserved words, and will cause you loads of headaches in the long run.


    That did it, thank you very much!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 10-25-2013, 08:49 AM
  2. Query help to summarize data by work week
    By saseymour in forum Queries
    Replies: 4
    Last Post: 07-18-2013, 07:29 AM
  3. Replies: 2
    Last Post: 11-04-2012, 02:08 PM
  4. Replies: 8
    Last Post: 09-26-2012, 01:51 PM
  5. query to summarize top ranking data
    By CMR in forum Queries
    Replies: 1
    Last Post: 09-17-2012, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums