Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Need a formula
Author
Message
avishalpatil
Newbie
Joined: 24 Dec 2010
Online Status: Offline
Posts: 13
Topic: Need a formula
Posted: 07 Jul 2011 at 6:59am
Hi ,
I have some "Gender" attribute in a database carrying values as follow:
1 - Male
2 - Female
3 - Not Specified
I want following should display on report.
Male
Female
Not Specified
Please suggest me the formula for this.
Regards & Thanks
Vishal
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 07 Jul 2011 at 7:10am
I think you are asking how to convert numbers to text?
if table.gender=1 then 'Male' else if table.gender=2 then 'Female' else if table.gender=3 then 'Not Specified' else 'Missing'
the else missing is optional but I usually add this to label items that are not in the rest of the formula statement tather than leave them blank
IP Logged
avishalpatil
Newbie
Joined: 24 Dec 2010
Online Status: Offline
Posts: 13
Posted: 07 Jul 2011 at 7:18am
Nope.
Complete string is coming from a database field i.e
(1 - Male).
I just want to print only Male.Other portion of the string i.e (1 - ) should be truncated.
Regards
Vishal
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 07 Jul 2011 at 8:04am
right(field,length(field)-4)
IP Logged
avishalpatil
Newbie
Joined: 24 Dec 2010
Online Status: Offline
Posts: 13
Posted: 07 Jul 2011 at 8:07pm
Thanks Dude !!!
It working....
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
BAEZL
© 2004-2026 Brian Bischof. All Rights Reserved.