Hi,
I have a formula that I can't get to work. Here it is:
StringVar FirstMiddle := ' ';
StringVar First := ' ';
StringVar Middle := ' ';
StringVar Last := ' ';
If InStr({ssemploy.empname},',') < 1 Then
If InStr({ssemploy.empname},' ') < 1 Then
Last := {ssemploy.empname}
Else
(First := Left({ssemploy.empname},InStr({ssemploy.empname},' ')) ;
Middle := Mid({ssemploy.empname},(InStr({ssemploy.empname},' ')+1)))
Else
FirstMiddle := Mid({ssemploy.empname},(InStr({ssemploy.empname},',')+2)) ;
If InStr (FirstMiddle, ' ') < 1 Then
(First := FirstMiddle ;
Last := Left({ssemploy.empname},InStr({ssemploy.empname},',')))
Else
(First := Left(FirstMiddle,InStr(FirstMiddle,' ')) ;
Middle := Mid(FirstMiddle,(InStr(FirstMiddle,' ')+1)) ;
Last := Left({ssemploy.empname},InStr({ssemploy.empname},','))) ;
First
I know that empname=Thermal Platter.
I also know that InStr({ssemploy.empname},' ') = 8. So I should be inside the Else of the 2nd If and First should = Thermal and Middle should = Platter. But I only get blank when I display either First or Middle. Anybody have any suggestions?
TIA,
Rena
I have a formula that I can't get to work. Here it is:
StringVar FirstMiddle := ' ';
StringVar First := ' ';
StringVar Middle := ' ';
StringVar Last := ' ';
If InStr({ssemploy.empname},',') < 1 Then
If InStr({ssemploy.empname},' ') < 1 Then
Last := {ssemploy.empname}
Else
(First := Left({ssemploy.empname},InStr({ssemploy.empname},' ')) ;
Middle := Mid({ssemploy.empname},(InStr({ssemploy.empname},' ')+1)))
Else
FirstMiddle := Mid({ssemploy.empname},(InStr({ssemploy.empname},',')+2)) ;
If InStr (FirstMiddle, ' ') < 1 Then
(First := FirstMiddle ;
Last := Left({ssemploy.empname},InStr({ssemploy.empname},',')))
Else
(First := Left(FirstMiddle,InStr(FirstMiddle,' ')) ;
Middle := Mid(FirstMiddle,(InStr(FirstMiddle,' ')+1)) ;
Last := Left({ssemploy.empname},InStr({ssemploy.empname},','))) ;
First
I know that empname=Thermal Platter.
I also know that InStr({ssemploy.empname},' ') = 8. So I should be inside the Else of the 2nd If and First should = Thermal and Middle should = Platter. But I only get blank when I display either First or Middle. Anybody have any suggestions?
TIA,
Rena