Results 1 to 3 of 3
  1. #1
    Casper is offline Novice
    Windows 10 Access 2007
    Join Date
    May 2016
    Posts
    1

    Sorting sales per customer.

    Hi there.


    I have some trouble sorting sales per customer.
    I have a tablet called ordre with the order number, date and customer nr.
    Then i have a tablet called : ordreline
    In there i got ID, Ordrenumber, ordreline, itemnumber and number purchased

    Im not sure with the code should be here.
    I know i need to put them together so it will count the amount of items bought per customer number, but i really have trouble finding out what that would sound like.

    Thanks in advance.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Select CustomerID, count(itemNum) from table.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Your post is interesting in that you are talking about Sales per Customer, but you do not have a Sales table or SaleNumber.
    You also ask for Sort.
    Ranman has offered a solution based on his interpretation of your request.

    Are you trying to count the number of Orders by Customer, or the number of Items????

    Code:
    Select [Customer nr], Count([Order number] from Ordre
    Group By [Customer nr];

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

Similar Threads

  1. Building a report comparing customer sales for 3 years
    By controller2850 in forum Reports
    Replies: 1
    Last Post: 03-04-2015, 04:07 PM
  2. Dsun function to sum the sales of each customer
    By falahsalih in forum Access
    Replies: 5
    Last Post: 06-06-2014, 06:58 AM
  3. Replies: 6
    Last Post: 12-11-2013, 09:27 PM
  4. Replies: 0
    Last Post: 12-13-2012, 03:18 AM
  5. Sorting by customer
    By eibooo in forum Queries
    Replies: 1
    Last Post: 05-25-2010, 12:00 AM

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