Filtering numbers

E

Erik P

I have a table that has two numbers and a dash followed by three numbers. In
my macro i have the table filter the the letters that i am searching for then
by the number but when you go to last record it shows example: SP-999 but the
SP-1000 is up in the list and it is not showing the highest record. I would
like to know of a way to make it show the SP-1000 instead of SP-999. I hope
thia makes sense. Thanks for any help in this.
 
K

KARL DEWEY

It is doing an alphbetical sort in that SP-1 comes beforw SP-9.
You need to use a calculated field in your query to parse the field into two
fields - the first two character and then the value of the rest. Value being
numerical value and not text for sorting.
Sort1: Left([YourField], 2)
Sort2: Val(Right[YourField], Len([YourField])-3))
The above is based on assumption the there is ALWAYS two character before
the dash.
 

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

Top