By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,525 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

Ordering numbers as text

P: 14
Hi I have a problem if one of my fields I chamge it to a text field.( I need to add some text on it) on an ascending ordered report it orders 10 then 100 then 5. How can I order properly my field not as a number but as a text field

regards,
Dec 6 '07 #1
Share this Question
Share on Google+
4 Replies


Nathan H
100+
P: 104
Hi I have a problem if one of my fields I chamge it to a text field.( I need to add some text on it) on an ascending ordered report it orders 10 then 100 then 5. How can I order properly my field not as a number but as a text field

regards,
My understanding is that is how it will order it in a text field. Reading left to right, 1 comes before 5. Suggest adding your text in a different field.
Dec 6 '07 #2

P: 14
HI Yes but 10 comes before 5 in this case

Thanks,
Dec 6 '07 #3

Nathan H
100+
P: 104
HI Yes but 10 comes before 5 in this case

Thanks,
Yes, but it is no longer 10, you converted it to text and so it is now 1 and a zero. Reading left to right, 1 comes before 5, so that is why you are seeing the sort order as 1,10,100,2,20,200, etc...

In a query, use this Val([field1]) which will return the number value and give you the sort you are looking for.
Dec 6 '07 #4

missinglinq
Expert 2.5K+
P: 3,532
You say you need to "add some text to it." Is this text the same each time, or is it always the same number of characters? Tell us a little about this.

The standard way to make digits entered as text order as you want is to add leading zeros thru formatting, but in a mixed alpha-numeric text field, you'd have to separate the alpha from the numeric component.

Welcome toTheScripts!

Linq ;0)>
Dec 6 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.