Indexing from the back(Primary Key)

  • Thread starter Thread starter Andy
  • Start date Start date
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
 
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.
 
Back
Top