Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    45

    Question Unanswered: Report sorting problem

    Hi everyone,

    I have the following problem:
    In a report I want to group data by one field /Employee/ and sort grouped data by another field /calculated field =Count([someNumber])/.
    But in a "Sorting and Grouping" window when you choose a grouping field it automatically sorts data by same field. Even if I add second field for sorting I can't remove first field sorting.
    Any ideas what should I do?

    Just to explain: I use adp and SQL server. In the past when I used pure Access I could do a crosstab query that makes all the counts and sorting I needed and then I used to made a report based on that query. But now with SQL server i use simple view and try to make report do all grouping, counting and sorting ...

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183

    Report sorting problem

    I guess your report result looks like the sample data below:

    HTML Code:
    Employee    Count      Fruits
    A              10      apple
    A               8      pineapple
    A               7      cherry
    A               4      mango
    B              15      banana
    B               7      apple
    B               4      mango
    Report sorts the data by the main Group field first. If it finds duplicates in the first Group field then takes the second field/expression for sorting.

    When you add a second field under the main group it will not ignore the main group and sort only on the second field.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  3. #3
    Join Date
    Jun 2003
    Posts
    45
    If i use your example, my report will look like this:
    Employee Total(Fruits)
    A 29
    B 26
    Report is grouped by field "Employee" and it automatically sorts data on this field. So even if i add sorting on "Total" it ignores it because data has already been sorted by Employees.

    By the way, I do grouping and sortung using GUI /not in code/ and in build-in "Sorting and group" window it sorts automatically the field that is "Group by".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •