Say if I have the following records in the table:
BB0906071
BB0906191
BB0906192
BB090619M
What I like to do is to search the last record that begin with BB and the current YYMMDD and any characters after is a character that can be made into an integer so that I can add a sequence to it by incrementing by 1. If it is a alpha character, then I would need to go to the previous record until I find one that has BB and then the date format for today and then a chacter that is an integer.
In the above sample, even though finding the last record I get BB090619M, I need to byplass this as M is not something that I can change to an integer. Thus, I need need to go the previous record of BB0906192 and increment by 1 to get me BB0906193.
I was wondering what the best way to do this would be. I was wondering if I could use a find last where string begins with DDYYMMDD and check to make sure that anything after that is a character that is an integer in one Find last statement.
Find Last table where table.fld1 begins "BB<YYMMDD>" AND....
Thanks in advance.
BB0906071
BB0906191
BB0906192
BB090619M
What I like to do is to search the last record that begin with BB and the current YYMMDD and any characters after is a character that can be made into an integer so that I can add a sequence to it by incrementing by 1. If it is a alpha character, then I would need to go to the previous record until I find one that has BB and then the date format for today and then a chacter that is an integer.
In the above sample, even though finding the last record I get BB090619M, I need to byplass this as M is not something that I can change to an integer. Thus, I need need to go the previous record of BB0906192 and increment by 1 to get me BB0906193.
I was wondering what the best way to do this would be. I was wondering if I could use a find last where string begins with DDYYMMDD and check to make sure that anything after that is a character that is an integer in one Find last statement.
Find Last table where table.fld1 begins "BB<YYMMDD>" AND....
Thanks in advance.