Metalteck
asked on
String Search in Crystal Report
I have comment field in my report that is delimited by commas and spaces;
ex:
Type=D, create user= test user1, modified user = test1, Apply to inventory
Captial#123456
SDE#78910
I'm trying to search the string and ONLY pull out the information that starts with SDE.
I"ve tried using the formula: split({L_HPCR.OBJECT},",") [4], but if the SDE# isn't right after the third comma, it won't display.
Anyone have any suggestions.
Thank you
ex:
Type=D, create user= test user1, modified user = test1, Apply to inventory
Captial#123456
SDE#78910
I'm trying to search the string and ONLY pull out the information that starts with SDE.
I"ve tried using the formula: split({L_HPCR.OBJECT},",")
Anyone have any suggestions.
Thank you
ASKER
At first it worked, but then I got an error saying" Start Position is less than 1 or not an integer".
Ideas?
Ideas?
Apparently you have strings without the SDE or NULL
Local NumberVar SDE_Loc;
If IsNull({L_HPCR.OBJECT}) then
"No String"
Else
(
SDE_Loc := InStr({L_HPCR.OBJECT},"SDE ");
If SDE_Loc > 0 then
Mid({L_HPCR.OBJECT},SDE_Lo c)
Else
"No SDE"
);
mlmcc
mlmcc
Local NumberVar SDE_Loc;
If IsNull({L_HPCR.OBJECT}) then
"No String"
Else
(
SDE_Loc := InStr({L_HPCR.OBJECT},"SDE
If SDE_Loc > 0 then
Mid({L_HPCR.OBJECT},SDE_Lo
Else
"No SDE"
);
mlmcc
mlmcc
ASKER
Thats perfect. One last question, what happens if SDE is in lowercase?
How would I capture all versions of the word sde?
How would I capture all versions of the word sde?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Local NumberVar SDE_Loc;
SDE_Loc := InStr({L_HPCR.OBJECT},"SDE
Mid({L_HPCR.OBJECT},SDE_Lo
mlmcc