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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

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

Suggested Solutions

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

751 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