Situation:
I have a "Name" field from an Oracle 7.3 database in a PeopleSoft 7 environment that is used in a Crystal 5.0 report. The name is currently stored in this format i.e. (AGNES,JOSEPH LEONARD JR or AVALOS,ALFRED JR or BARONOWSKI,GARY WALTER). It is convenient that these three names come up in my query first since they represent three different formatting problems.
The problem is that the name needs to be rearranged in the following order:
JOSEPH LEONARD AGNES JR
ALFRED AVALOS JR
GARY WALTER BARONOWSKI
I was successful in rearranging the names to the correct format. I run into a problem in the instance between the 2nd and 3rd examples. They both have the same number of names (3) since my calculations recognize the "JR" for AVALOS as the second name. In turn, I get one of the two result sets depending on how I change the concatenation of my variables in the formula:
ALFRED AVALOS JR
GARY BARONOWSKI WALTER
or
ALFRED JR AVALOS
GARY WALTER BARONOWSKI
I cannot do a StrLen on the last part of the "Name" and expect it to be two or three characters in length and say that this is my suffix because some last names are two or three characters.
I need to find a way to decipher between the two examples that I'm having problems w/. A database change has about a 0.01% chance of happening, and, even then, it wouldn't happen for months.
Any help would be appreciated!! TIA!!
Jody
I have a "Name" field from an Oracle 7.3 database in a PeopleSoft 7 environment that is used in a Crystal 5.0 report. The name is currently stored in this format i.e. (AGNES,JOSEPH LEONARD JR or AVALOS,ALFRED JR or BARONOWSKI,GARY WALTER). It is convenient that these three names come up in my query first since they represent three different formatting problems.
The problem is that the name needs to be rearranged in the following order:
JOSEPH LEONARD AGNES JR
ALFRED AVALOS JR
GARY WALTER BARONOWSKI
I was successful in rearranging the names to the correct format. I run into a problem in the instance between the 2nd and 3rd examples. They both have the same number of names (3) since my calculations recognize the "JR" for AVALOS as the second name. In turn, I get one of the two result sets depending on how I change the concatenation of my variables in the formula:
ALFRED AVALOS JR
GARY BARONOWSKI WALTER
or
ALFRED JR AVALOS
GARY WALTER BARONOWSKI
I cannot do a StrLen on the last part of the "Name" and expect it to be two or three characters in length and say that this is my suffix because some last names are two or three characters.
I need to find a way to decipher between the two examples that I'm having problems w/. A database change has about a 0.01% chance of happening, and, even then, it wouldn't happen for months.
Any help would be appreciated!! TIA!!
Jody