I was working on the implementation of that idea because I like testing a
solution before offering it. Here is what I did
1 - adding a nu_col char(original width + 7)
2 - updating that column with
space$(7 - instr(1,original_col," "))+orginal_col
3 - sorting on this new column.
7 is a semi arbitrary number, it should be at least the maximum number of
digits in the street numbers, it can be larger.
This procedure works perfectly for "straight" number addresses. If the
number is not properly separated by at least a space from the street name,
or if the "numbers" contain also letters (123A or 456bis) there will be
problems.
I really prefer this kind of puzzle!
Jacques PARIS
mailto:[EMAIL PROTECTED]
For MapInfo support, visit the Paris PC Consult enr. site at
http://www.paris-pc-gis.com/
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of David Booth
Sent: April 27, 2001 6:57 AM
To: 'Morrier, Steve'; MapInfo List (E-mail)
Subject: RE: MI-L Sorting
Hi Steve,
If you put spaces in front of the numbers (eg ^^1,^^2,^11 etc. where ^
represents a space) the sort seems to do what you want - ie gives
1
2
3
10
11
100
followed by any alphabetic stuff.
You're going to need to know the maximum number of digits in your road
numbers (eg if there are four digits, then pad out the numbers to four chars
using leading spaces). You may even be able to do it automatically using an
update column statement, if you can isolate the numeric streets, that is.
Hope this helps - at any rate it's got to be better than the "use order by"
suggestions you seem to have got so far!
Dave.
---------------------------------------------
David Booth
Senior GIS Officer
Merseyside Information Service
> -----Original Message-----
> From: Morrier, Steve [SMTP:[EMAIL PROTECTED]]
> Sent: 26 April 2001 19:46
> To: MapInfo List (E-mail)
> Subject: MI-L Sorting
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
>
> Sorry,
>
> I should have specified that I am sorting street files and the column
> contains highways that must be displayed as numbers. So converting my
> field
> from character to integer is not an option. Thanks for everyones help.
>
> Steve
>
>
> Original Question:
>
> Is there any way to get MapInfo to sort numerically? i.e.
> 1,2,3,4,5,34,78,100
> instead of 1,10, 100, 2, 20, etc...
>
>
>
>
> _______________________________________________________________________
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, send e-mail to [EMAIL PROTECTED] and
> put "unsubscribe MapInfo-L" in the message body.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.