Sorting Alphanumeric values in query/report.

  • Thread starter Thread starter julostarr
  • Start date Start date
J

julostarr

In my database I am trying to sort my companies part numbers. They contain
both letters and number, for example 22D10-2, 21BC123, 25TD47, 38WS101 or
21D10 are some of the part numbers. In my products list table they sort in
the correct order, which is first by number then by letter then by number
again, but I created a query, which I'm using for a report on our Booked
Sales for the year, and I want to sort it first by the month then by the part
number. Everything sorts fine except for a group of a few part numbers which
should be further down in the list. These mis-sorted numbers are sorted
correctly within the little group, but they are not sorted correctly within
the entire list of part numbers. A part number like 25TD47 is in between
part number 21D10-2 and 21FA101. This doesn't make since to me.

Can anyone help me out with fixing this problem?
 
In my database I am trying to sort my companies part numbers. They contain
both letters and number, for example 22D10-2, 21BC123, 25TD47, 38WS101 or
21D10 are some of the part numbers. In my products list table they sort in
the correct order, which is first by number then by letter then by number
again, but I created a query, which I'm using for a report on our Booked
Sales for the year, and I want to sort it first by the month then by the part
number. Everything sorts fine except for a group of a few part numbers which
should be further down in the list. These mis-sorted numbers are sorted
correctly within the little group, but they are not sorted correctly within
the entire list of part numbers. A part number like 25TD47 is in between
part number 21D10-2 and 21FA101. This doesn't make since to me.

Can anyone help me out with fixing this problem?

The report's sorting is controlled by the Sorting and Grouping property of the
report. Your table *has no order* - it should be viewed as an unordered heap
of records. Only if you specify the sort order in a Query or a report's
Sorting and Grouping do you have any control over the order.

What have you done to sort by month then part?

John W. Vinson [MVP]
 
Don't sort in the query. Instead sort within the report using the Sorting and
Grouping options. Reports throw away the sort order of any query and does the
sorting within the report. That could explain your strange results.
 
Ok, I took the sort off the query and the report sorting was already set, but
the results in the report remain the same.
 
Back
Top