Results 1 to 4 of 4
  1. #1
    josekreif is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    27

    my totals query is not grouping

    Click image for larger version. 

Name:	broken.PNG 
Views:	7 
Size:	24.1 KB 
ID:	21978



    I have the name and the month grouped. The numbers are all sum

    Code:
    SELECT Customer.[Sales Person], [Delivery].[Month] & ":   " & MonthName([Delivery].[Month],True) AS [Month], Sum(Delivery.[Kgs Sold]) AS [SumOfKgs Sold], Sum(Delivery.[include VA Extended Value]) AS [SumOfinclude VA Extended Value], Sum(Delivery.[net of VAT]) AS [SumOfnet of VAT], Sum(Delivery.[Billed USD]) AS [SumOfBilled USD]
    FROM Delivery LEFT JOIN Customer ON Delivery.Customer = Customer.[Customer Name]
    WHERE (((Delivery.Customer) Is Not Null))
    GROUP BY Customer.[Sales Person], [Delivery].[Month] & ":   " & MonthName([Delivery].[Month],True);
    IF IT HELPS


    Click image for larger version. 

Name:	extra.PNG 
Views:	7 
Size:	17.1 KB 
ID:	21979

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    is data in the [delivery].[month] an actual month name 'july', or is it a DATE, 7/1/15?
    IF its a date, then you are getting different years july 2014, and 2015.

    or some other field is in the query, not showing, but causing the 2 different 'Feb's.

  3. #3
    josekreif is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    27
    Quote Originally Posted by ranman256 View Post
    is data in the [delivery].[month] an actual month name 'july', or is it a DATE, 7/1/15?
    IF its a date, then you are getting different years july 2014, and 2015.

    or some other field is in the query, not showing, but causing the 2 different 'Feb's.
    Hi thank you for replying.

    The month holds only a number, and the delivery only holds information of the current year, 2015.

    Here it is in simple terms.

    Code:
    SELECT Customer.[Sales Person], Delivery.Month
    FROM Delivery LEFT JOIN Customer ON Delivery.Customer = Customer.[Customer Name]
    GROUP BY Customer.[Sales Person], Delivery.Month;
    Click image for larger version. 

Name:	broken2.PNG 
Views:	7 
Size:	5.8 KB 
ID:	21980


    Should I write a procedure to sum these up?

    EDIT:

    YIKES. Looks like Access doesnt like these names.
    Click image for larger version. 

Name:	yikes.PNG 
Views:	7 
Size:	4.0 KB 
ID:	21981


    This data in entered from China, so I'm guessing there are formatting errors. Something to do with ASCII or similar.

  4. #4
    josekreif is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    27
    My hunch was right. This is a ASCII problem

    I copy and paste the names and here is what I get

    Jia Jianrong: 074 105 097 032 074 105 097 110 114 111 110 103 013 010

    Jia Jianrong: 074 105 097 194 160 074 105 097 110 114 111 110 103 013 010

    This is a spacebar issue, researching further, it's a known problem "194 160"

    For anyone with this issue
    Replace([Customer].[Sales Person],Chr(160)," ")
    Last edited by josekreif; 09-08-2015 at 10:07 AM.

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

Similar Threads

  1. Replies: 3
    Last Post: 06-27-2013, 10:18 AM
  2. Need help with totals/grouping
    By Leon_SF in forum Queries
    Replies: 3
    Last Post: 02-08-2012, 09:51 AM
  3. Reports Grouping Totals in details
    By slatterie in forum Reports
    Replies: 1
    Last Post: 01-27-2012, 07:10 PM
  4. Replies: 5
    Last Post: 12-06-2011, 11:18 AM
  5. Grouping query
    By Mphiri in forum Programming
    Replies: 10
    Last Post: 06-15-2010, 08:58 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