Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replacing text in a field 1

Status
Not open for further replies.

rynosims

Technical User
Nov 14, 2001
12
US
Is there a formula that I can change the displayed value of a field? For instance, I deal with airplanes, and airplane statuses. The Database I use has status code "NMCMSA". I want Crystal Reports do display "DEPOT" anytime that "NMCMSA" would be displayed. The database does not have "DEPOT" anywhere in any field.
Please Help!
Thank You
 
You can create a formula to handle this.

if {fieldname} = "NMCMSA" then "Depot"
else {fieldname} (or whatever text you might want to display)
 
I tried that, but I get the message "The formula result must be a boolean."
 
It sounds lkike the field you are testing may be a Boolean. If it is, change the formula to:
If {fieldname} = True (or false) then "Depot"
else "SOME OTHER TEXT"

Or if you don't want anything to show other than "Depot" leave off the "else"
 
Okay, but there is more data than just NMCMSA. If I say just TRUE, then anything will turn into DEPOT. Do I make it say
if {fieldname} = "NMCMSA" then "DEPOT"
else {fieldname} = FMC or
else {fieldname} = NMCM

Is thet how I could do it?
 
What kind of field are you testing? String, Boolean, Number, etc.

Assuming that {fieldname} is a string field, the first formula I supplied would display "Depot" if the field contents are "NMCMSA" or if the field didn't contain "NMCMSA", it would display the orininal data. "FMC" or "NMCM"



 
Thank you all for the information. I finally got it to work. I know a good place to go to for Crystal Reports Info thanks to you guys. I am new to the whole database thing, so I might be asking a few more questions here. I already know a few I want to ask, but I am not quite there yet!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top