Re: Sort 1, 1A, 2,3,4,9,10,10A,11,23,45,

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




Marshall thanks for the reply. I inserted this in the SQL statement of the
query but still did not sort correctly. Maybe I'm doing something wrong. The
following is the query.

SELECT Circuit.RevStatus, Circuit.CircuitNumber, Circuit.ServiceType,
Circuit.Volts, Circuit.FromEquipment, Circuit.ToEquipment,
Circuit.CablesInCircuit, Circuit.LengthOfCable, Circuit_detail.WiresInCable,
Circuit_detail.WiresNotUsed, Circuit_detail.Size, Circuit_detail.Material,
Title.DrawingNumber, Title.RevNumCurrent, Title.Remarks, Title.Station,
Title.Plant, Title.Company, Title.Title, Title.Location
FROM Title, Circuit INNER JOIN Circuit_detail ON Circuit.CircuitNumber =
Circuit_detail.CircuitNum
ORDER BY Val([CircuitNumber]);

It is an unusual sort in number order and take the letters into account
also. In the example I first posted they are wanting a logical number order
1-31 but Access starts with 11-MO599DCA then 1AC13-PCB536 and 31-C1 comes
before 3-1M1. From what I gather it's a Microsoft issue.

Kelly


"Marshall Barton" wrote:

Kelly wrote:

Does anyone know how to sort on a text field with numbers. One of the fields
I'm using requires a combination of letters and numbers and they want it
sorted a specific way. The following is how it sorts now.
11-MO599DCA
12-MO599DC
13-PCB602C1
1AC13-PCB536
1AC13-PCB536A
2-PCB602C3
2-PCB602C3A
2R-TB7
2-TB1
2-TB5
31-C1
31-C2
31-C3
3-1M1
3-1M2
They would prefer it be sorted this way.
1AC13-PCB536
1AC13-PCB536A
2-PCB602C3
2-PCB602C3A
2-TB1
2-TB5
2R-TB7
3-1M1
3-1M2
11-MO599DCA
12-MO599DC
13-PCB602C1
31-C1
31-C2
31-C3


Try inserting another sort level above the field sort using
the expression:
=Val([the text field])

If that doesn't do what you want, please provide a more
detailed explanation about what's wrong.

--
Marsh
MVP [MS Access]

.



Relevant Pages

  • Re: Make Table Query - Sorting Errors
    ... Dim OutputTable As DAO.Recordset ... The query to concatenate the CAMPNO values will need to be LOOKING at the ... If you post the query you are using to do this, I beleive we can get it to ... Is there a command that I can use in the module code to first sort the ...
    (microsoft.public.access.queries)
  • Re: Make Table Query - Sorting Errors
    ... You sort in a query, ... You can do a compound sort in a query. ... "Tom Ellison" wrote: ... resulting table only has one record for each value of "CAMPNO". ...
    (microsoft.public.access.queries)
  • Re: Query doesnt always sort
    ... You have to use a query to sort the data in to your required order and then ... Access MVP 2002-2005, 2007 ... University of Maryland Baltimore County ... How do I impose a sort on the datasheet view? ...
    (microsoft.public.access.queries)
  • Re: Make Table Query - Sorting Errors
    ... MS Access MVP ... resulting table only has one record for each value of "CAMPNO". ... Is there a command that I can use in the module code to first sort the ... I have a make table query that is supposed to sort in ascending order ...
    (microsoft.public.access.queries)
  • Re: Make Table Query - Sorting Errors
    ... sorted, it will sort them as they arrive. ... you query them, why is this of any concern to you? ... correctly on the field CAMPNO. ... "Duane Hookom" wrote: ...
    (microsoft.public.access.queries)