Problem to sort a field

  • Thread starter Thread starter azlina
  • Start date Start date
A

azlina

hola....
i got a problem..actually i want to sort a field in database..but the
field has char and num value..i need to sort it ascending by
number...like this A1,A2,A3,A100,A200,A300..bcoz when i have sort it
asc it become like this..A1,A100,A2,A200,A3,A300...can u help me with
this problem??plz..
 
separate the text part of the value and the numeric part and then sort
by the text field then the numeric field.
 
hola....
i got a problem..actually i want to sort a field in database..but the
field has char and num value..i need to sort it ascending by
number...like this A1,A2,A3,A100,A200,A300..bcoz when i have sort it
asc it become like this..A1,A100,A2,A200,A3,A300...can u help me with
this problem??plz..

Ideally, do as Pietlinden says and separate the field.

If the text portion is always one byte long, create a calculated field

Val(Mid([fieldname], 2))

and sort by it.

John W. Vinson[MVP]
 
tq john and pietlinden..
but...i want the fie name still have A infront of the numbers..actualy
my real file name are..A10.bmp,A103.bmp,A4.bmp,A401.bmp...can i sort it
to be like this A4.bmp,A10.bmp,A103.bmp,a401.bmp???






John said:
hola....
i got a problem..actually i want to sort a field in database..but the
field has char and num value..i need to sort it ascending by
number...like this A1,A2,A3,A100,A200,A300..bcoz when i have sort it
asc it become like this..A1,A100,A2,A200,A3,A300...can u help me with
this problem??plz..

Ideally, do as Pietlinden says and separate the field.

If the text portion is always one byte long, create a calculated field

Val(Mid([fieldname], 2))

and sort by it.

John W. Vinson[MVP]
 
tq john and pietlinden..
but...i want the fie name still have A infront of the numbers..actualy
my real file name are..A10.bmp,A103.bmp,A4.bmp,A401.bmp...can i sort it
to be like this A4.bmp,A10.bmp,A103.bmp,a401.bmp???

So? You can *sort* by the calculated field, and *display* the
filename. Did you try it?

John W. Vinson[MVP]
 
yeah...i've try that...but i got a problem when run it..it said
"undefine function in expression"
 
yeah...i've try that...but i got a problem when run it..it said
"undefine function in expression"

Then fix the problem in the query.

If you would like help doing so, please open the query in SQL view and
post the SQL text here. We can't see it from this distance!

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sorting Problem 4
Sorting 3
Excel =SUM(A1=A1+B1) 0
Find range differens between two ranges/areas? 3
Lookup question 3
Sorting Problem 5
How copy data form multi cells to one cell? 1
sort alphabetical in report 4

Back
Top