Results 1 to 4 of 4
  1. #1
    KMac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    6

    Sorting on group totals

    I have a query that goes out and selects all records entered within the last 15 days. In effect, you could get 15 records for an individual route#, one for each day with it's number of complaints for that date.I then created a Report based on the results of the query and group it by route#. I then count the number of times that route# is listed within the group. I get results ranging from route#s showing up 7 or 8 times to route#s only showing up once. My query results may bring in 50 or more records. Plus the only way I can seem to sort it that makes sense is based on Route# and then I may have a route# that shows a total in the grouping of say 5, followed by a bunch of totals of 1 then followed by a route# that is grouped together 8 times.

    What I would like to do is create a report that only shows me those individuals listed 4 or more times in the last 15 days sorted by the highest number of occurences down to those with 4 occurences.

    Here is the SQL query:


    SELECT Multiples.IssueDate, Multiples.RouteNumber, Multiples.StartDate, Multiples.Complaints, Multiples.Reason, Multiples.ActionTaken
    FROM Multiples
    WHERE (((Multiples.IssueDate)>Date()-15));

    Is there any way I can select or report on only those RouteNumbers that are listed 4 or more times and then sort highest to lowest based on number of occurences?

    Thanks!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Reports have their own sorting and grouping.

  3. #3
    KMac is offline Novice
    Windows XP Access 2013
    Join Date
    Dec 2012
    Posts
    6
    Agreed....but I can't find a way to sort a report based on a group total.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Possible options:

    1. The report RecordSource would have to be aggregate query. This means would not have detail records.

    2. Use a DSum() domain aggregate calc in report RecordSource and use that constructed field as grouping criteria in the report design. Could possibly even do the DSum() calc in an expression in the report grouping setup.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-22-2013, 03:28 PM
  2. Group on a totals field
    By dharsh in forum Access
    Replies: 14
    Last Post: 07-11-2013, 10:43 AM
  3. Sorting in Totals Query
    By Bertrand82 in forum Queries
    Replies: 1
    Last Post: 11-26-2012, 07:17 AM
  4. Sorting within a group
    By BLD21 in forum Reports
    Replies: 3
    Last Post: 04-08-2011, 11:59 AM
  5. Group Totals in a form
    By mai1081 in forum Forms
    Replies: 1
    Last Post: 05-14-2008, 06:11 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