Print Page | Close Window

Change a number field to text

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15457
Printed Date: 05 May 2024 at 5:59am


Topic: Change a number field to text
Posted By: crystalsonic
Subject: Change a number field to text
Date Posted: 26 Jan 2012 at 5:55am
I am running Crystal XI and I need to change a field on a report from a number to text based on a condition. The number field in the database is either a zero or a 1. On the report I would for the zero to display as YES and for the 1 to display as NO. Is this done via the HIGHLIGHT expert or the Formula Workshop?
 
 



Replies:
Posted By: DBlank
Date Posted: 26 Jan 2012 at 6:04am

Field Explorer

formula field
right click select new
if table.field=0 then 'YES' else if table.field=1 then 'NO' else 'ERROR'
 
Or place the field on the report
right click on it
select format field
Common tab
display string formula box
if currentfieldvalue=0 then 'Yes' else if currentfieldvalue=1 then 'No' else 'Error'


Posted By: crystalsonic
Date Posted: 26 Jan 2012 at 6:28am
Thanks for your help! It worked great! :)



Print Page | Close Window