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: formula?
Author
Message
jbalbo
Senior Member
Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Topic: formula?
Posted: 21 Mar 2011 at 1:07pm
Hi,
Im trying to create a field to write according to a value:
For example
if field1 = 1 then field2(Which I create) = field3 + "months"
so field1 is coded for month , field3 is number of months, field2 is the
concatination.
Field1 = 1
Field3= 4
I want field2 to say "4 month(s)"
Does this make sense?
Thanks
Joe
IP Logged
FrnhtGLI
Senior Member
Joined: 22 May 2009
Online Status: Offline
Posts: 347
Posted: 22 Mar 2011 at 2:05am
if {table.field1}=1
then {table.field3} & ' months'
else
(whatever you want your
else
to be)
|< /\ '][' ( )
IP Logged
jbalbo
Senior Member
Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Posted: 22 Mar 2011 at 2:58am
that works great .. thanks..
but becuase the field in numeric, I get 1.00, I want just 1 ?
Thanks in Advance...
IP Logged
FrnhtGLI
Senior Member
Joined: 22 May 2009
Online Status: Offline
Posts: 347
Posted: 22 Mar 2011 at 3:17am
if {table.field1}=1
then totext({table.field3}, 0) & ' months'
else
(whatever you want your
else
to be)
The correction above to {table.field3} should get you your desired result.
|< /\ '][' ( )
IP Logged
jbalbo
Senior Member
Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Posted: 22 Mar 2011 at 10:47am
Thanks works great..
What if I want to display another field( a date field) if the value is -1?
if field1 = -1 then I want to display field5..
can I hide field3 and make field5 visble if field1 = -1?
Thanks
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.