3 Replies Latest reply on Feb 22, 2012 7:04 AM by Vincent_L

# how to sort "the second last digit"

### Title

how to sort "the second last digit"

### Post

here is my problem

i only want to sort the second last digit from numbers

ex :

Before sorting

1. 142905

2. 141084

3. 146715

4. 143751

After sorting

1. 142905

2. 146715

3. 143751

4. 141084

I can do it easily in EXCEL, but i have tried for months but still can not solve this problem in FileMaker.

• ###### 1. Re: how to sort "the second last digit"

you create a calc field which will be the secon last digit Middle(thevalue;length(thevalue)-2;1) and you do your sort on this calc field

• ###### 2. Re: how to sort "the second last digit"

I too have been wondering if this was possible!

I am still a little bit confused by what you mean by "second last digit middle (thevalue ; kength (the value) -2;1)"  could you possibly give an example using the numbers above?

thank you!

• ###### 3. Re: how to sort "the second last digit"

You create a calculation field (in manage database / fields)

you name is "whatyouwant"

you define it as

Middle(thevalue;length(thevalue)-2;1)   this is the cacl field formula

then, when you want to sort, you sort upon the field "whatyouwant"