jbrannen333
asked on
Crystal Reports Replace Portion of String Starting with
Need to turn variable account name into shortened string.
Example:
Salaries (Global, NF)
Salaries (CP, NF)
Vehicle Repair (Maint, NF)
needs to turn into:
Salaries
Salaries
Vehicle Repair
Replace( dbo.Acctname, "(*", "") and Replace( dbo.Acctname, "*(*", "")
are not working. Are wildcards recognized in Crystal Replace? I'm pretty sure I've used wildcard replace in both SQL and access.
Example:
Salaries (Global, NF)
Salaries (CP, NF)
Vehicle Repair (Maint, NF)
needs to turn into:
Salaries
Salaries
Vehicle Repair
Replace( dbo.Acctname, "(*", "") and Replace( dbo.Acctname, "*(*", "")
are not working. Are wildcards recognized in Crystal Replace? I'm pretty sure I've used wildcard replace in both SQL and access.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You colud also use
Local NumberVar leftparen := Instr(dbo.Acctname,"(") - 2;
Left({dbo.Acctname},leftpa ren )
mlmcc
Local NumberVar leftparen := Instr(dbo.Acctname,"(") - 2;
Left({dbo.Acctname},leftpa
mlmcc
ASKER
Replace(dbo.AcctName, MID(dbo.AcctName, InStr(dbo.Acctname, "(")),"")
rhinok's solution looks a lot cleaner though.