In our software program we have the client enter their name like the following:
Brown, Sharon
That is how it is stored in the table.
I have one report I need to write but I need the names to display as First Name then Last Name.
I was given the following formula to use but it does not seem to work. Any suggestions?
WhilePrintingRecords();
NumberVar nPlace;
StringVar szFirstHalf;
StringVar szSecondHalf;
InStr({PATIENT.pat_name}, ","
if(nPlace <> 0)
then szFirstHalf := Left({PATIENT.pat_name}, nPlace-1);
if(nPlace <> 0)
then szSecondHalf := Right({PATIENT.pat_name}, (Length({PATIENT.pat_name})-nPlace));
if(nPlace <> 0)
then szFirstHalf+szSecondHalf
else {PATIENT.pat_name};
Brown, Sharon
That is how it is stored in the table.
I have one report I need to write but I need the names to display as First Name then Last Name.
I was given the following formula to use but it does not seem to work. Any suggestions?
WhilePrintingRecords();
NumberVar nPlace;
StringVar szFirstHalf;
StringVar szSecondHalf;
InStr({PATIENT.pat_name}, ","
if(nPlace <> 0)
then szFirstHalf := Left({PATIENT.pat_name}, nPlace-1);
if(nPlace <> 0)
then szSecondHalf := Right({PATIENT.pat_name}, (Length({PATIENT.pat_name})-nPlace));
if(nPlace <> 0)
then szFirstHalf+szSecondHalf
else {PATIENT.pat_name};