Re: Sorting field with alpha numeric data
- From: "Gary Walter" <garylwPULLEZE@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Jun 2006 12:29:27 -0500
"saggyaccess via AccessMonster.com" wrote:
I'm using Access 2000 and I have a field which contains sample data as
follows: 4, 101 a-d, 54-56 6(a,b,c), 99, 104, 249a&249b and data type
assigned to this field is text. Since this field combines text and
numbers,
is there anyway to sort this data in ascending order, also as its text
field
4 comes after 39, I found that I should replace it with 04 , is there any
other method to sort this data numerically in perfect ascending order.
First, I'm not sure *how* you would
sort above in "perfect ascending order."
You probably should have listed them
out down the page as you believe that
order should be.
That way I might not have bothered
you with what I typically do. 8-)
In previous situations such as above
I usually create an extra sort field in
my query using method you already
alluded to and sort on that.
RIGHT('000000000000' & [yourfield], 12)
but you have "extra non-numbers," so assuming
"perfect" means "first digits" and all chars sort
before digits:
Right('000000000000' & CInt(Val([test])),12)
which would sort your list above as
a-d
4
6(a,b,c)
54-56
99
101
104
249&249b
good luck,
gary
.
- References:
- Sorting field with alpha numeric data
- From: saggyaccess via AccessMonster.com
- Sorting field with alpha numeric data
- Prev by Date: Re: Make table Query not "updating" 1 field
- Next by Date: RE: Creating a function to automated this command! (EMAIL)
- Previous by thread: Re: Sorting field with alpha numeric data
- Next by thread: Re: Format painter in queries
- Index(es):
Relevant Pages
|