Part No. Sort - in middle

We have a rather strange setup on our part numbers. Positions 5,6 contain the product line and on reports they want to sort on these 2 positions and not the first 4 characters.

I don’t have access to Table design to setup a new Key.

Any suggestions would be greatly appreciated.


There’s no way that this can be accomplished without doing any table design. You could maybe put the value of those two positions into an existing field such as Item Category (if that’s not already used) and sort it that way.

If such sorting is required for report, you can use temporarry records for sorting.

Thanks for the advice.

How do you setup Temporary records??

You need to create record type variable with property Temporary = Yes. For subtype of variable choose table which has required key - in your case, I think you need variable with two Code Type fields on primary key. Then go through your records, assign to first field of temporary record value of 5,6 positions and full value to second field, insert temporary record. Then you need to go through sorted temorary records and output required information. It is short explanation, hope it helps. It is not very easy to explain without writing full code… Try to look to report 111 Customer - Top 10 List for example of using temporary records.

Thanks again. Right now I’m using the ??? 4 question marks and filtering out the records.

I will check Report 111 today.