Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Reports Replace Portion of String Starting with

Posted on 2011-02-14
3
Medium Priority
?
878 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
[X]
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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 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