cancel
Showing results for 
Search instead for 
Did you mean: 

alpha and numeric need to sort on the numeric values only

Former Member
0 Kudos

Hi there, I am new to Crystal reports and I have a crystal report that I need to sort on the Supp field, which currently contains alpha and numeric data, i.e

AB321234V

CA121432V

MHHA122421V

I need to sort the report into the ascending numeric part of this reference, so it ignores the letters in front.

any help would be much appreciated. thank you

I am using Crystal 2008

Former Member
0 Kudos

hi there, that worked perfectly, thank you,

Is there any way that once it is sorted by the numerical value, it can be sorted so that anything that contains "b" will come towards the end of the report? thank you

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Lindsey,

Create a formula with this code:

local stringvar s := {Alphanumeric Field};
local stringvar s2;
numbervar i;
for i := 1 to len(s) do
(
    If isnumeric(s[i]) then
        s2 := s2 + s[i];
);
toNumber(s2);

You should then be able to use this formula field in the Report Sort Expert.

-Abhilash

Former Member
0 Kudos

Thank you. I will try this in the morning

Answers (1)

Answers (1)

Former Member
0 Kudos

thank you I will try this in the morning. Much appreciated.