Indexing from the back(Primary Key)

A

Andy

Hi,
I faced a problem when i tried to index my primary key.

This is the description of my primary key
ORDER 9 DIGIT TRANSACTION NUMBER; FIRST TWO DIGIT INDICATING MONTH OF
ORDER; NEXT TWO DIGIT INDICATING YEAR OF ORDER

So when i tried to index it, the counting starts from the front
010600001
010600002

the problem comes when when it started to sort from the month

010600010
010700585

instead of 020600011 as i want it to be.
This there anyway to make the indexing based from teh back 4 digits?
Thanks
 
J

Jerry Whittle

In Access indexing has nothing to do with sort order (aside from maybe
speeding it up). You will need to sort on a field in a query. Assuming that
the numbers are always 9 characters:

Sorted: Mid([TheFieldName],6,4)

Then sort on this field.

BTW: Using a field that has "meaning" at the primary key can often present
problems.
 

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