Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i sort numbers in a text field?

Status
Not open for further replies.

ruthcali

Programmer
Apr 27, 2000
470
US
I am using Access97 in a Novell environment.<br><br>I have a table with a text field called Values.<br>That field contains the values:<br><br>01/02<br>03/04<br>05/06<br>07/08<br>09/10<br>11/12&nbsp;&nbsp;... etc<br>ending with<br>107/108<br><br>but Access sorts everything as if they were 3 digit numbers. so it put the 101/102 record after the 09/10 since it considers the 09/10 actually 090.<br><br>besides going through all my data and adding leading zeroes to the two digit numbers, is there any way i can get Access to sort normally?<br><br>
 
well, i found a way. i guess it isn't the most professional way, but it works. <br><br>i changed the values from 101/102 to I01/I02. can you see the difference? i am using the letter I instead of the number 1.<br><br>well, it works.<br>do you see any potential problem with this in the future?<br><br>
 
Access doesn't consider the 09/10 as 090.&nbsp;&nbsp;It is simply sorting on the characters from left to right.&nbsp;&nbsp;The &quot;0&quot; in 090 is numerically before the &quot;1&quot; in 101.&nbsp;&nbsp;What order would you like the numbers in?&nbsp;&nbsp;Perhaps I am not understanding what you are attempting to achive.&nbsp;&nbsp;Are you trying to sort on the numbers to the left of the &quot;/&quot;.&nbsp;&nbsp;If you give me some specifics I might be able to help somewhat.<br><br>Karen
 
hi,<br>i want the numbers sorted as follows:<br>01/02<br>03/04<br>05/06<br>07/08<br>09/10<br>11/12<br>13/14<br>15/16<br>17/18<br>19/20<br>21/22<br>and so on up until<br>99/100<br>101/102<br>103/104<br>105/106<br>107/108<br><br>But, Access sorts it in this order:<br>01/02<br>03/04<br>05/06<br>07/08<br>09/10<br>101/102<br>103/104<br>105/106<br>107/108<br>11/12<br>13/14<br>and so on.<br><br>i found a solution by using the letter I instead of the number 1 for the 3 digit numbers.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top