Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Reports Replace Portion of String Starting with

Posted on 2011-02-14
3
Medium Priority
?
892 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:jbrannen333
3 Comments
 
LVL 26

Accepted Solution

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

{dbo.Acctname} [1 to leftparen]

~Kurt
0
 

Author Comment

by:jbrannen333
ID: 34891125
Got  the following to work

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

rhinok's solution looks a lot cleaner though.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 34891409
You colud also use

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

Left({dbo.Acctname},leftparen )

mlmcc
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

971 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