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: IF statement
Author
Message
Central
Groupie
Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Topic: IF statement
Posted: 06 Oct 2011 at 1:19am
What is the correct syntax for multi rows in an if statement as I keep getting problems
How is this done
If Len(Of a Field) > 1 then
Address = "ABC"
SomethingElse = "1234"
else
Address = "DEF"
SomethingElse = "9876"
endif
IP Logged
Robotacha
Groupie
Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Posted: 06 Oct 2011 at 3:26am
IF Len({table.field}) >1 THEN "ABC" ELSE
IF Len({table.field}) >2 THEN "DEF" ELSE
IF Len({table.field}) >3 THEN "GHK"
so basically, IF {argument} THEN {returnvalue} ELSE
you wont need the 'endif'
simply leave off the last ELSE
Edited by Robotacha - 06 Oct 2011 at 3:28am
Regards,
Michael Jones
IP Logged
Robotacha
Groupie
Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Posted: 06 Oct 2011 at 3:30am
If you want mulitple return values then use:
IF Len({table.field})>1 THEN {table.address}="ABC" AND {table.somethingelse}="1234" ELSE
Edited by Robotacha - 06 Oct 2011 at 3:35am
Regards,
Michael Jones
IP Logged
Central
Groupie
Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Posted: 06 Oct 2011 at 3:31am
Thanks for both these solutions and a speedy reply.
Edited by Central - 06 Oct 2011 at 3:32am
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
|
KONACAD
© 2004-2026 Brian Bischof. All Rights Reserved.