Re: Sorting Problem in Report

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



That is a proper sort for a text field that is storing number characters.

Try changing the sort to
= Val([DistrictField])


Val will convert the number string to a number.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

phnomda wrote:
On May 13, 4:54 pm, Jerry Whittle
<JerryWhit...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Where are you doing the sorting? How it's in the table or even a query
doesn't matter. You must set the sort order in the report.

Would it happen to be numerical characters stored in a text field? That can
cause problems like so:

111
22
222
33

That's because text is sorted from left to right.

Leading spaces can also cause problem.

Maybe you could show examples of the problem.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.



"phnomda" wrote:
I'm having a problem that seems like it should be easy to fix... and
yet I can't seem to fix it. I would like in a report to group by one
of the fields in a table, and would like the grouping to be in
ascending order. The report is grouping by the field, but it is all
out of order. No matter what I do, it retains the same, wrong, non-
ascending order. The table is in ascending order, and the field on the
report is set to ascending order. Any idea why, with so much ascending
order, it is still coming up out of order? Any help would be greatly
appreciated!- Hide quoted text -
- Show quoted text -

There are numbers involved-- it's a sorting of districts, which are
assigned numerical values. So the order that comes up is:

10
11
12
13
..etc
1
22
23
2

How do I get around this? Any help would be appreciated!

Thanks!
.



Relevant Pages

  • Re: Sorting by complex alphanumeric data
    ... sort as though it were a true Year. ... I didn't know that you could write statements into the sorting and grouping ... most likely could use in the Report Sorting & Grouping what I gave you above ... The first one characters are always letters. ...
    (microsoft.public.access.reports)
  • Re: Sorting field with alpha numeric data
    ... characters in the string. ... If yourField starts with a letter, the Val function will return zero. ... is there anyway to sort this data in ascending order, ... other method to sort this data numerically in perfect ascending order. ...
    (microsoft.public.access.queries)
  • Re: Sorting Problem in Report
    ... You must set the sort order in the report. ... Jerry Whittle, Microsoft Access MVP ... ascending order. ...
    (microsoft.public.access.gettingstarted)
  • Re: Sort field in report
    ... It still did not give me ascending order ... the data to sort on check numbers in the report. ... >Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP ...
    (microsoft.public.fox.helpwanted)
  • Re: Sorting mixed alphanumeric data
    ... I am trying to sort serial numbers. ... characters, ... ascending order and then numbers in ascending order ... I would prefer the sort to work in a query. ...
    (microsoft.public.access.modulesdaovba)