A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sorting of numeric data in text column



 
 
Thread Tools Display Modes
  #1  
Old August 4th, 2004, 12:25 PM
M Vally
external usenet poster
 
Posts: n/a
Default Sorting of numeric data in text column

how do I get a numric sequence of numbers in a text
column if numbers are like this 1-001,1-002,2-001,10-001
at the moment I get 1-001,1-002,10-001,2-001

Thaks in advance
  #2  
Old August 4th, 2004, 12:52 PM
Rick Brandt
external usenet poster
 
Posts: n/a
Default Sorting of numeric data in text column

"M Vally" wrote in message
...
how do I get a numric sequence of numbers in a text
column if numbers are like this 1-001,1-002,2-001,10-001
at the moment I get 1-001,1-002,10-001,2-001


Well, those values are not numbers as numbers don't contain dashes. In a
query you could sort on an expression...

SortValue: Val([FieldName])

That would return the numeric value up to the dash. You might need an
additional expression to sort on everything after the dash...

SortValue2: Val(Mid([FieldName], InStr(1, [FieldName], "-")+1))

That should return the numeric value represented by the digits after the
dash. The two could be combined into a single field to sort on if desired.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a coma to the text data in every row of a column Larry General Discussion 6 June 28th, 2004 12:48 AM
Adding a coma to the text data in every row of a column Larry Worksheet Functions 1 June 26th, 2004 01:43 AM
Reversing Sign on Column of Data (Positive to Negative) (Negative to Postive) M Stokes Worksheet Functions 1 April 26th, 2004 04:33 PM
Column separator crosses through wrapped text box Bob S Page Layout 0 April 25th, 2004 09:52 PM


All times are GMT +1. The time now is 04:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.