Link to home
Start Free TrialLog in
Avatar of Mark Wilson
Mark Wilson

asked on

Replace Problem

I have data in one of the fields I am reporting against as below

Will for John Smith
Will For John Blogg

I want to remove the Will for to just have the name left i.e. John Smith, John Blogg

I am using the formula below

replace(database_field, 'Will for ','')

When I use this I am left with

John Smith and Will For John Blogg, i.e. it still leaves the one with the capital F for For.

How can make this work so I am left with John Smith, John Blogg from the example data
Avatar of BlueYonder
BlueYonder

It appears the formula is used not used in the group or details sections.  The formula field must be in the group or details section.  If the field is not group or details sections the formula is not run for each record.
If you want to complete the replacement before crystal loads the data, you can use a t-sql statement to the database.  Here are instructions http://hexcentral.com/articles/crystal-sql.htm.
Avatar of PortletPaul
nest the replace function?

replace(replace(database_field, 'Will for ',''),'Will For ','')
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@mlmcc - excellent!
Where does one find formal online doco for crystal functions these days?
I don't know of an online help.  I use the help from Crystal installed on my machine.

mlmcc
:( pity - thanks anyway