Crystal Reports Replace Portion of String Starting with

Posted on 2011-02-14
Last Modified: 2012-05-11
Need to turn variable account name into shortened string.


Salaries (Global, NF)
Salaries (CP, NF)
Vehicle Repair (Maint, NF)

needs to turn into:

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.
Question by:jbrannen333
LVL 26

Accepted Solution

Kurt Reinhardt earned 125 total points
ID: 34891007
Local NumberVar leftparen := Instr(dbo.Acctname,"(") - 2;

{dbo.Acctname} [1 to leftparen]


Author Comment

ID: 34891125
Got  the following to work

Replace(dbo.AcctName, MID(dbo.AcctName, InStr(dbo.Acctname, "(")),"")

rhinok's solution looks a lot cleaner though.
LVL 100

Expert Comment

ID: 34891409
You colud also use

Local NumberVar leftparen := Instr(dbo.Acctname,"(") - 2;

Left({dbo.Acctname},leftparen )


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now