Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorting a report (2003)

    I have a database of information that I have created a report from. It provides a sign in sheet sorted in alphabetical order by the individual's last name. How do have it sort and print by last names beginning with A - C, D - F, G - I, etc. ? I need it to separate each section instead of printing it all together.

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sorting a report (2003)

    I suppose you can group the report by using expressions such as
    [lastname] like "[A-C]*"

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Sorting a report (2003)

    Are these letter combinations always in lots of 3? eg, A-C, D-F, etc

    If they are, then create a new field in the query called Break and calculated as :

    Fix((Asc(Left(IndivLastName,1)) - Asc("A") + 3) / 3)

    then use this field as a break in the report.

    This expression generates 1 if the 1st char of the individuals name is A - C, or 2 if D - F, etc

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sorting a report (2003)

    When you say, "use this field as a break in the report", do you mean putting it in the Field/Expression column of the Sorting and Grouping window?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sorting a report (2003)

    Patt is not online at the moment. I think that's what he meant.

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Sorting a report (2003)

    Here is an extension of Patt's idea.

    Add a Group field to the Query, then put it in the Sorting and Grouping Dialog, and give it a Group Header.

    Put the Group field into the Group Header.
    Regards
    John



Posting Permissions

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