AlohaMichael
Programmer
I have a list of ID's stored in a string field in an sql database. (see lists below) I would like to use a formula to get the proper sorting. The issue is CR is sorting them like below.
Default Desired
Sorting Sorting
RFIID RFIID
001.001 001.001
002 1.005
003.004 002
005.001a 3
006.12 003.004
007.018 3.812
1.005 4.001
100.001 005.001a
101.002 006.12
101.020 007.018
110.003 100.001
110.02 101.002
110.1 101.020
3 110.003
3.812 110.02
4.001 110.1
The issue is having the ID stored as a string and users have a tendency to throw in random letters in to the ID field.
The formula I have to sort the field is as follows
numbervar ctr1;
numbervar rfinum := 999;
for ctr1 := length({Requests for Information.RFI~Number}) to 1 step -1 do
(
if numerictext (left( {Requests for Information.RFI~Number}, ctr1) ) then
(
rfiNUM := tonumber (left({Requests for Information.RFI~Number}, ctr1));
exit for;
)
);
rfiNUM;
Ideally I am trying to get the ID number into the following format 123.123 but if the user doesn't put the ID number in that format I want to be able to handle it as best as possible.
Any suggestions / ideas?
No, I have no way of Normalizing the ID's they are stored on a 3rd Partys database. Additionally there are over 35,000 ID's in the system. I know, I know I am trying to make CR do things it wasn't designed to do.
Default Desired
Sorting Sorting
RFIID RFIID
001.001 001.001
002 1.005
003.004 002
005.001a 3
006.12 003.004
007.018 3.812
1.005 4.001
100.001 005.001a
101.002 006.12
101.020 007.018
110.003 100.001
110.02 101.002
110.1 101.020
3 110.003
3.812 110.02
4.001 110.1
The issue is having the ID stored as a string and users have a tendency to throw in random letters in to the ID field.
The formula I have to sort the field is as follows
numbervar ctr1;
numbervar rfinum := 999;
for ctr1 := length({Requests for Information.RFI~Number}) to 1 step -1 do
(
if numerictext (left( {Requests for Information.RFI~Number}, ctr1) ) then
(
rfiNUM := tonumber (left({Requests for Information.RFI~Number}, ctr1));
exit for;
)
);
rfiNUM;
Ideally I am trying to get the ID number into the following format 123.123 but if the user doesn't put the ID number in that format I want to be able to handle it as best as possible.
Any suggestions / ideas?
No, I have no way of Normalizing the ID's they are stored on a 3rd Partys database. Additionally there are over 35,000 ID's in the system. I know, I know I am trying to make CR do things it wasn't designed to do.