I am working in Crystal XI against an Oracle database. I need to sort my data alpha-numerically. I have a lot of different combinations of alpha and numeric data. The data is drawing numbers for old facilities where there are often up to 100,000 rows to be sorted. Example:
5A90-1
5A90-2
5A90-12
5A90-15
5A90-28
5A90-95
5A90-146
5A90-175-001
5A90-175-002
5A90-175-003
5A90-175A-001
5A90-175B-001
5A90-175C-001
5A90-175C-002
5A90-175C-003
5A90-175C-003A
5A90-175C-003D
5A90-175C-003M
5A90-175C-003M/9AS61B
5A90-175C-003M/9AS61L
... and so on. The first five characters are manageable but starting with position six I am not able to get the data to sort as I need it to.
I have tried this:
Stringvar MyString:=Mid({Command.DRAWING_NUMBER},6);
Stringvar SOutput;
numbervar x;
SOutput := " ";
for x := 1 to len(MyString)
do (
if Not(NumericText(mid(MyString,x,1))) then
SOutput:= SOutput + mid(MyString,x,1);
);
SOutput;
... but this is not working as I would expect. Any help is greatly appreciated.
Thanks,
Bob
5A90-1
5A90-2
5A90-12
5A90-15
5A90-28
5A90-95
5A90-146
5A90-175-001
5A90-175-002
5A90-175-003
5A90-175A-001
5A90-175B-001
5A90-175C-001
5A90-175C-002
5A90-175C-003
5A90-175C-003A
5A90-175C-003D
5A90-175C-003M
5A90-175C-003M/9AS61B
5A90-175C-003M/9AS61L
... and so on. The first five characters are manageable but starting with position six I am not able to get the data to sort as I need it to.
I have tried this:
Stringvar MyString:=Mid({Command.DRAWING_NUMBER},6);
Stringvar SOutput;
numbervar x;
SOutput := " ";
for x := 1 to len(MyString)
do (
if Not(NumericText(mid(MyString,x,1))) then
SOutput:= SOutput + mid(MyString,x,1);
);
SOutput;
... but this is not working as I would expect. Any help is greatly appreciated.
Thanks,
Bob