J
Jason Puckett
Field names used are:
strFirstName, strMiddleName, strLastName
Example 1: strFirstName=John | strMiddleName=Null | strLastName=Long
Example 2: strFirstName=B. | strMiddleName=A. | strLastName=Smith
Example 3: strFirstName=O. | strMiddleName=Bill | strLastName=Wilson
Example 4: strFirstName=Sam | strMiddleName=A. | strLastName=Johnson
As they are entered above, I can get them to appear as follows using a
fairly simple concatenation such as Name: [strFirstName]&("
"+[strMiddleName])&" "&[strLastName]
John Long
B.A. Smith
O. Bill Wilson
Sam A. Johnson
My goal is to have the preceding examples appear as follows:
John Long
B.A. Smith
Bill Wilson
Sam Johnson
Essentially, leaving out strMiddleName if null OR it contains only an
initial AND strFirstName contains more than an initial, leaving out
strFirstName if it contains only an initial AND strMiddleName is more than
just an initial, using strFirstName and strMiddleName if they both contain
only an initial.
It didn't seem like it was going to be so complex when I first thought about
it but like so many other issues like this, it's become a bear all of a
sudden. I'm trying to accomplish this in a query but if it isn't possible I'd
be open to any other suggestions. Any assistance would be greatly
appreciated.
TIA
JP
strFirstName, strMiddleName, strLastName
Example 1: strFirstName=John | strMiddleName=Null | strLastName=Long
Example 2: strFirstName=B. | strMiddleName=A. | strLastName=Smith
Example 3: strFirstName=O. | strMiddleName=Bill | strLastName=Wilson
Example 4: strFirstName=Sam | strMiddleName=A. | strLastName=Johnson
As they are entered above, I can get them to appear as follows using a
fairly simple concatenation such as Name: [strFirstName]&("
"+[strMiddleName])&" "&[strLastName]
John Long
B.A. Smith
O. Bill Wilson
Sam A. Johnson
My goal is to have the preceding examples appear as follows:
John Long
B.A. Smith
Bill Wilson
Sam Johnson
Essentially, leaving out strMiddleName if null OR it contains only an
initial AND strFirstName contains more than an initial, leaving out
strFirstName if it contains only an initial AND strMiddleName is more than
just an initial, using strFirstName and strMiddleName if they both contain
only an initial.
It didn't seem like it was going to be so complex when I first thought about
it but like so many other issues like this, it's become a bear all of a
sudden. I'm trying to accomplish this in a query but if it isn't possible I'd
be open to any other suggestions. Any assistance would be greatly
appreciated.
TIA
JP