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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ok this one should be easy

Status
Not open for further replies.

bryan3473

MIS
Sep 25, 2003
21
US
I have a field that return a numerical value 1 thru 12, each number represents a company i.e. 0 = Best Way, 1 = U.S. Transportation. How do i tell C.R. to replace the Number with the text field. The text is not anywhere in the database so i was hoping i could just create a formula and tell it waht each number equals.

thank Bryan
 
Hi,
Exactly. create a formula that uses the Switch Function to translate the code into whatever you want the text to say..
Or write a series of If..Then..else statements, or use IIF.

The CR help file has many examples..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
i dont have the cr help file lol it was never installed and out 8.5 disk is missing its so fun
 
Hi,
Expand on this example:

( In spite of my last answer, this format is better for your need):
Code:
Select {table.fieldwithcodenumber}
   Case 0 : "Best Way"
   Case 1 : "U.S. Transportation"
   Default: "";

I think it works in 8.5...


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks for all the help

it tells me a string is required here and it puts the cursor right after case and befor the 0
 
Hi,
I was sort of afraid of that..Crystal likes all things to be the same type so:
Code:
Select totext({table.fieldwithcodenumber},'0')
   Case "0" : "Best Way"
   Case "1" : "U.S. Transportation"
   Default: "";


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
If it's already a string, you would just need;

Select {table.fieldwithcodenumber}
Case "0" : "Best Way"
Case "1" : "U.S. Transportation"
Default: "";

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top